-
Notifications
You must be signed in to change notification settings - Fork 54
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
Implementing right hand side operations #204
Conversation
…hand_side_operators
Codecov Report
@@ Coverage Diff @@
## master #204 +/- ##
=========================================
+ Coverage 96.28% 96.3% +0.01%
=========================================
Files 47 47
Lines 6731 6762 +31
=========================================
+ Hits 6481 6512 +31
Misses 250 250
Continue to review full report at Codecov.
|
…hand_side_operators # Conflicts: # heat/core/tests/test_tensor.py
heat/core/tests/test_tensor.py
Outdated
('__mod__', operator.mod, False), | ||
('__pow__', operator.pow, False) | ||
) | ||
tensor = ht.float32([[1, 4], [2, 3]]) |
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.
We need test cases here for split tensors
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 related to #167, which needs to be fixed first
At the moment, binary operations do not work properly for split tensors.
heat/core/tensor.py
Outdated
__radd__ = __add__ | ||
__rmul__ = __mul__ | ||
|
||
# __rfloordiv__ // TODO: Implement me when implementing __floordiv__ |
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.
Please provide both implementations (regular and right-hand side floor-div). Straight forward by adapting div (torch supports truediv as well)
heat/core/tensor.py
Outdated
@@ -451,41 +451,93 @@ def __truediv__(self, other): | |||
""" | |||
return arithmetics.div(self, other) | |||
|
|||
def __rtruediv__(self, other): |
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.
Just a technicality, but shouldn't the functions be sorted alphabetically? (at least for the operators before it is the case)
EDIT: This goes for all the operators below
…hand_side_operators # Conflicts: # heat/core/arithmetics.py # heat/core/dndarray.py # heat/core/tests/test_factories.py
c16680c
to
a1f4a8f
Compare
…hand_side_operators
Bump, please update to the current master, would want to merge :) |
Target #168.
Added right-hand-side implementations for all implemented operations like "/", "%", ...