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
Add relevant shape check for tf.reshape to prevent crash #46717
Add relevant shape check for tf.reshape to prevent crash #46717
Conversation
2093bb2
to
d8f90e5
Compare
tensorflow/core/kernels/reshape_op.h
Outdated
} | ||
return errors::InvalidArgument("Shape [", msg, | ||
"] has too many elements"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation here looks wrong; might be a spaces (the rest of the file) vs. tabs issue?
d8f90e5
to
7c30cad
Compare
Thanks @allenlavoie for the review. Indeed that was a tab issue. I have updated the PR and fixed it. Please take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice fix
The merge isn't working because we have some presubmits which run the test in a 1.x-style Graph+Session. Can you please decorate the test method with "@test_util.run_v2_only"? |
This PR tries to address the issue raised in 46693 where a shape with large number of elements will cause the tf.reshape to crash. This PR adds relevant shape check so that error message can be returned gracefully. This PR fixes 46693 Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
7c30cad
to
a41733a
Compare
This PR tries to address the issue raised in #46693 where
a shape with large number of elements will cause the
tf.reshape to crash.
This PR adds relevant shape check so that error message can
be returned gracefully.
This PR fixes #46693
This PR also fixes #46699
Signed-off-by: Yong Tang yong.tang.github@outlook.com