-
Notifications
You must be signed in to change notification settings - Fork 72
[IR] Introduce short name for dtypes #2249
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
❌ 25 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 introduces a shorter string notation for ONNX data types and adds utility methods for converting between the short name and the full enum representation.
- Adds tests to verify the short name conversion and access by name.
- Implements two new methods in _enums.py: from_short_name (a class method) and short_name to enable conversions.
- Introduces mapping dictionaries to support the new short name functionality.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
onnxscript/ir/_enums_test.py | Added tests to ensure proper short name conversion and enum access by name |
onnxscript/ir/_enums.py | Added from_short_name and short_name methods with corresponding mappings |
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.
Where do we use the short-names (when generating some output, for eg)? Where can we use the short-names (when parsing which input)? Just wondering
I am still debating. Initially I was thinking model builder constant value names but I realized the long names may be more preferable there |
Introduce short name for dtypes as a more compact way of describing the data types in strings. Users can already access the enums by name with e.g.
ir.DataType["DOUBLE"]
.