diff options
author | TensorFlower Gardener <gardener@tensorflow.org> | 2018-08-08 18:02:21 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-08-08 18:02:21 -0700 |
commit | f2ff7b160794f2fd8ea5bafb1e910f1c14966202 (patch) | |
tree | 1c838d8fee9075f1105e62219af4cddd8d2ad1ae /tensorflow/compiler | |
parent | 7df18e0e6f8629dd097a7b71845d9e13d926944a (diff) | |
parent | 76b3aae602d298c43db08f3822567f4c32338871 (diff) |
Merge pull request #20497 from rongjiecomputer:accumulate
PiperOrigin-RevId: 207976861
Diffstat (limited to 'tensorflow/compiler')
-rw-r--r-- | tensorflow/compiler/xla/array.h | 2 | ||||
-rw-r--r-- | tensorflow/compiler/xla/service/indexed_array_analysis.cc | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tensorflow/compiler/xla/array.h b/tensorflow/compiler/xla/array.h index ea75ad32d5..2d5d078aa7 100644 --- a/tensorflow/compiler/xla/array.h +++ b/tensorflow/compiler/xla/array.h @@ -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>()); } diff --git a/tensorflow/compiler/xla/service/indexed_array_analysis.cc b/tensorflow/compiler/xla/service/indexed_array_analysis.cc index 8b2df32567..3531b7223f 100644 --- a/tensorflow/compiler/xla/service/indexed_array_analysis.cc +++ b/tensorflow/compiler/xla/service/indexed_array_analysis.cc @@ -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)); |