-
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
dialects: (builtin) DenseIntOrFPElementsAttr: make data private and use getters instead #3535
Conversation
…se getters instead
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3535 +/- ##
=======================================
Coverage 90.35% 90.36%
=======================================
Files 466 466
Lines 58481 58515 +34
Branches 5582 5583 +1
=======================================
+ Hits 52841 52877 +36
+ Misses 4210 4208 -2
Partials 1430 1430 ☔ View full report in Codecov by Sentry. |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
Seems sensible to me, I would just rename is_scalar
to is_splat
though
and val.is_splat() | ||
): | ||
return val.data.data[0] | ||
return val.get_attrs()[0] |
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.
very nice
…se getters instead (xdslproject#3535) To prepare for the change of internal data representation, this PR makes the actual data of the attribute a private attribute. Everthing is accessed with the getters `get_attrs` (IntegerAttr, ...) and `get_values` (int, float). The check whether the dense is set by a scalar is pretty common, so i included an additional helper function for that as well
To prepare for the change of internal data representation, this PR makes the actual data of the attribute a private attribute. Everthing is accessed with the getters
get_attrs
(IntegerAttr, ...) andget_values
(int, float).The check whether the dense is set by a scalar is pretty common, so i included an additional helper function for that as well