-
Notifications
You must be signed in to change notification settings - Fork 72
[torchlib] Set allowzero=True on Reshape where appropriate #2346
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
Conversation
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.
Pull Request Overview
This PR updates multiple calls to op.Reshape across the torch library to include allowzero=True, ensuring that reshaping operations correctly handle dynamic shapes that may contain zeros.
- Updated op.Reshape invocations in several functions to pass allowzero=True.
- Adjusted functions in instance normalization, pixel shuffle/unshuffle, unique operations, and view operations.
Comments suppressed due to low confidence (1)
onnxscript/function_libs/torch_lib/ops/core.py:4534
- Consider adding unit tests that cover scenarios where dynamic shapes include zeros to verify that op.Reshape correctly handles these cases when allowzero=True is set.
allowzero=True
❌ 14 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
@gramalingam could you reapprove? I fixed the unflatten test case |
When we reshape from a dynamic shape, the shape can contain zeros. This change accounts for those cases.