-
Notifications
You must be signed in to change notification settings - Fork 77
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
interpreter: add type property to ShapedArray #3709
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3709 +/- ##
=======================================
Coverage ? 91.33%
=======================================
Files ? 467
Lines ? 58548
Branches ? 5647
=======================================
Hits ? 53472
Misses ? 3626
Partials ? 1450 ☔ View full report in Codecov by Sentry. |
xdsl/interpreters/shaped_array.py
Outdated
@@ -25,6 +25,10 @@ class ShapedArray(Generic[_T]): | |||
_data: TypedPtr[_T] | |||
shape: list[int] | |||
|
|||
@property | |||
def type(self) -> PackableType[_T]: |
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.
is this not get_element_type?
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.
Good point, that's that we use in builtin.py
and the camelcase version of this is used in MLIR (e.g., TypeUtilities.cpp
and friends)
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.
This is the interpreter utility class, not the attribute. I guess we might want type to return some kind of ShapedType in the future, I'll rename this element_type for now.
xdsl/interpreters/shaped_array.py
Outdated
@@ -25,6 +25,10 @@ class ShapedArray(Generic[_T]): | |||
_data: TypedPtr[_T] | |||
shape: list[int] | |||
|
|||
@property | |||
def type(self) -> PackableType[_T]: |
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.
Good point, that's that we use in builtin.py
and the camelcase version of this is used in MLIR (e.g., TypeUtilities.cpp
and friends)
Previously not exposed.