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: (arith) Add custom syntax for arith.constant #1170
Conversation
@@ -652,7 +652,7 @@ def _print_attr_string(self, attr_tuple: tuple[str, Attribute]) -> None: | |||
self.print(f'"{attr_tuple[0]}" = ') | |||
self.print_attribute(attr_tuple[1]) | |||
|
|||
def _print_op_attributes(self, attributes: Dict[str, Attribute]) -> None: | |||
def print_op_attributes(self, attributes: Dict[str, Attribute]) -> None: |
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.
@math-fehr I made this API public so custom ops can print the default attribute dict as well.
Will push another PR to adopt this in the rest of the codebase.
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.
See #1171
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.
Yes!
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1170 +/- ##
==========================================
+ Coverage 88.61% 88.66% +0.05%
==========================================
Files 158 160 +2
Lines 22180 22300 +120
Branches 3326 3345 +19
==========================================
+ Hits 19654 19773 +119
+ Misses 1990 1989 -1
- Partials 536 538 +2
☔ View full report in Codecov by Sentry. |
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.
Nice!
docs/database_example.ipynb
Outdated
@@ -38,7 +38,14 @@ | |||
"cell_type": "code", | |||
"execution_count": 1, | |||
"id": "7aaf5d7c", | |||
"metadata": {}, |
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.
Can you use --ClearMetadataPreprocessor.enabled=True
when you update the notebooks?
That get rid of the metadata
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.
Thanks!
@@ -652,7 +652,7 @@ def _print_attr_string(self, attr_tuple: tuple[str, Attribute]) -> None: | |||
self.print(f'"{attr_tuple[0]}" = ') | |||
self.print_attribute(attr_tuple[1]) | |||
|
|||
def _print_op_attributes(self, attributes: Dict[str, Attribute]) -> None: | |||
def print_op_attributes(self, attributes: Dict[str, Attribute]) -> None: |
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.
Yes!
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.
Imagien how much smaller this PR would be if we had used the testing dialect more extensively 😉
if isinstance(value, FloatAttr): | ||
typ = value.type | ||
else: | ||
typ = value.typ |
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.
😢
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.
Tru
No description provided.