mirror of https://github.com/llvm/torch-mlir
[MLIR] Fix 64-bit product during aten.view lowering (#3378)
std::accumulate needs 64-bit init value to perform 64-bit arithmetic on a list of integers. Signed-off-by: Gaurav Shukla <gaurav.shukla@amd.com>pull/3382/head
parent
d924d0047f
commit
43f961eca4
|
@ -38,7 +38,8 @@ using namespace mlir::torch;
|
||||||
using namespace mlir::torch::Torch;
|
using namespace mlir::torch::Torch;
|
||||||
|
|
||||||
static int64_t productReduce(ArrayRef<int64_t> a) {
|
static int64_t productReduce(ArrayRef<int64_t> a) {
|
||||||
return accumulate(a.begin(), a.end(), /*init=*/1, std::multiplies<int64_t>());
|
return accumulate(a.begin(), a.end(), /*init=*/static_cast<int64_t>(1),
|
||||||
|
std::multiplies<int64_t>());
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename OpTy, typename OpAdaptor>
|
template <typename OpTy, typename OpAdaptor>
|
||||||
|
|
Loading…
Reference in New Issue