-
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
Bug/464 unique torch tensor #465
Conversation
Codecov Report
@@ Coverage Diff @@
## master #465 +/- ##
==========================================
+ Coverage 96.68% 96.69% +<.01%
==========================================
Files 57 57
Lines 12134 12147 +13
==========================================
+ Hits 11732 11745 +13
Misses 402 402
Continue to review full report at Codecov.
|
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.
One question about the number of arguments.
heat/core/manipulations.py
Outdated
a._DNDarray__array, sorted=sorted, return_inverse=return_inverse, dim=axis | ||
) | ||
if isinstance(torch_output, tuple): | ||
heat_output = tuple(factories.array(i, dtype=a.dtype) for i in torch_output) |
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.
different number of arguments?
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.
also the array calls should have a device parameter
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.
and split
if isinstance(torch_output, tuple): | ||
heat_output = tuple(factories.array(i, dtype=a.dtype) for i in torch_output) | ||
else: | ||
heat_output = factories.array(torch_output, dtype=a.dtype, split=None, device=a.device) |
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.
different number of arguments?
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.
everything looks good after the changes are made
heat/core/manipulations.py
Outdated
a._DNDarray__array, sorted=sorted, return_inverse=return_inverse, dim=axis | ||
) | ||
if isinstance(torch_output, tuple): | ||
heat_output = tuple(factories.array(i, dtype=a.dtype) for i in torch_output) |
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.
also the array calls should have a device parameter
heat/core/manipulations.py
Outdated
a._DNDarray__array, sorted=sorted, return_inverse=return_inverse, dim=axis | ||
) | ||
if isinstance(torch_output, tuple): | ||
heat_output = tuple(factories.array(i, dtype=a.dtype) for i in torch_output) |
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.
and split
Thanks a lot @mtar and @coquelin77 , you're correct, I made the changes you requested, merging and closing now. |
Description
Output of ht.unique(x) used to be a torch tensor or a tuple of torch tensors if
x.split is None
, it is now either a heat tensor, or a tuple of heat tensors in all cases.Issue/s resolved: #464
Changes proposed:
Type of change
Remove irrelevant options:
Due Diligence
Does this change modify the behaviour of other functions? If so, which?
no