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

static int64 GetDirectConvCost - Integer overflow #13

Open
iurii-kvasniuk opened this issue Aug 28, 2019 · 0 comments
Open

static int64 GetDirectConvCost - Integer overflow #13

iurii-kvasniuk opened this issue Aug 28, 2019 · 0 comments

Comments

@iurii-kvasniuk
Copy link

tensorflow-allreduce/tensorflow/core/kernels/deep_conv2d.cc: ln 74,
static int64 GetDirectConvCost(int filter_rows, int filter_cols, int in_depth,
int out_depth, int out_rows, int out_cols) {
return filter_rows * filter_cols * in_depth * out_depth * out_rows * out_cols;
}

Can lead to integer overflow and weird results
I think, it should be smth like that
return (int64)filter_rows * (int64)filter_cols * (int64)in_depth * (int64)out_depth * (int64)out_rows * (int64)out_cols;

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

No branches or pull requests

1 participant