-
Notifications
You must be signed in to change notification settings - Fork 72
Update autocast.py to fix attribute creation error #2365
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
❌ 4 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
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 the internal helper for creating ONNX AttributeProto
objects so that the type
field is passed as an integer rather than an enum, fixing type errors when setting attributes.
- Changed the
attr_type
annotation to use Python’s union syntax. - Wrapped
attr_type
inint()
for allonnx.AttributeProto
constructor calls.
Comments suppressed due to low confidence (1)
onnxscript/_internal/autocast.py:66
- Add unit tests covering cases where
attr_type
is a tensor and wherevalue
is an empty list to ensure theint(attr_type)
conversion is applied correctly.
return onnx.AttributeProto(name=key, type=int(attr_type))
Updated to fix the callers instead |
Are failing checks more than usual? |
They seem like the usual windows flakiness & unresolved issues with the latest ort. We should fix them though at some point. |
This change should fix the type of errors like below (reported in pytorch/pytorch#153214 (comment)):