-
Notifications
You must be signed in to change notification settings - Fork 73
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
bug: Fix cse for FloatData #3396
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3396 +/- ##
==========================================
+ Coverage 90.13% 90.14% +0.01%
==========================================
Files 452 452
Lines 57157 57159 +2
Branches 5498 5498
==========================================
+ Hits 51519 51528 +9
+ Misses 4180 4175 -5
+ Partials 1458 1456 -2 ☔ View full report in Codecov by Sentry. |
xdsl/dialects/builtin.py
Outdated
@@ -636,6 +636,9 @@ def __eq__(self, other: Any): | |||
math.isnan(self.data) and math.isnan(other.data) or self.data == other.data | |||
) | |||
|
|||
def __hash__(self): | |||
return super().__hash__() |
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.
Does this work? Would cut out the middle man
return super().__hash__() | |
return hash(self.data) |
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.
It does indeed
Co-authored-by: Sasha Lopoukhine <[email protected]>
FloatData recently received an
__eq__
method to handlenan
inequalities. Because of this change, it also needs to provide a__hash__
method.