Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There might be a overflow problem here for multiply int numbers. #4551

Open
github-actions bot opened this issue Jan 13, 2025 · 0 comments
Open

There might be a overflow problem here for multiply int numbers. #4551

github-actions bot opened this issue Jan 13, 2025 · 0 comments

Comments

@github-actions
Copy link

Line: 286

* @param[in] x Tensor x.
**/
int numel(const paddle_infer::Tensor& x) const {
// TODO: There might be a overflow problem here for multiply int numbers.
int ret = 1;
std::vector<int> x_shape = x.shape();
for (std::size_t i = 0, n = x_shape.size(); i < n; ++i) {
ret *= x_shape[i];
}
return ret;
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants