Merge pull request #20497 from rongjiecomputer:accumulate

PiperOrigin-RevId: 207976861
This commit is contained in:
TensorFlower Gardener 2018-08-08 18:02:21 -07:00
commit f2ff7b1607
2 changed files with 3 additions and 3 deletions

View File

@ -409,7 +409,7 @@ class Array {
// Returns the total number of elements in the array.
int64 num_elements() const {
return std::accumulate(sizes_.begin(), sizes_.end(), 1,
return std::accumulate(sizes_.begin(), sizes_.end(), 1LL,
std::multiplies<int64>());
}

View File

@ -447,7 +447,7 @@ int64 FindSourcePositionForPassthroughResultDim(ArraySlice<int64> operand_shape,
int64 indexed_source_subarray_size =
std::accumulate(operand_shape.begin() + source_passthrough_dim + 1,
operand_shape.end(), 1, std::multiplies<int64>());
operand_shape.end(), 1LL, std::multiplies<int64>());
return FindSuffixWithProduct(result_shape, indexed_source_subarray_size);
}
@ -764,7 +764,7 @@ IndexedArrayAnalysis::FoldReshapeOfGatherNoDegenerateDims(
&new_scalar_indexed_source_shape, source_dim_for_new_scalar_indexed_node,
scalar_indexed_source_shape.dimensions(scalar_indexed->source_dim()));
CHECK_EQ(c_accumulate(new_scalar_indexed_source_shape, 1l,
CHECK_EQ(c_accumulate(new_scalar_indexed_source_shape, 1LL,
std::multiplies<int64>()),
ShapeUtil::ElementsIn(scalar_indexed_source_shape));