Unverified Commit 13cae89e authored by Shang Zhang's avatar Shang Zhang Committed by GitHub
Browse files

Tensor numel() return dtype to be size_t (#2022)



Fix tensor numel() return dtype

The original dytpe int would be an issue if the tensor element numbers are larger than int32's range (which is not a super large number in real workloads)
Signed-off-by: default avatarShang Zhang <shangz@nvidia.com>
parent c444bf53
...@@ -88,7 +88,7 @@ struct SimpleTensor { ...@@ -88,7 +88,7 @@ struct SimpleTensor {
nvte_make_shape(this->shape.data(), this->shape.size())}; nvte_make_shape(this->shape.data(), this->shape.size())};
} }
int numel() const { size_t numel() const {
size_t acc = 1; size_t acc = 1;
for (const auto &dim : shape) { for (const auto &dim : shape) {
acc *= dim; acc *= dim;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment