-
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
Feature/737 isreal iscomplex #738
Conversation
Codecov Report
@@ Coverage Diff @@
## master #738 +/- ##
=======================================
Coverage 95.98% 95.98%
=======================================
Files 63 63
Lines 8060 8069 +9
=======================================
+ Hits 7736 7745 +9
Misses 324 324
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
sanitation.sanitize_in(x) | ||
|
||
if issubclass(x.dtype, _complexfloating): | ||
return x.imag != 0 | ||
else: | ||
return factories.zeros(x.shape, bool, split=x.split, device=x.device, comm=x.comm) |
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.
why not use torch.is_complex
?
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.
I did not find it 🔍 😄
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.
torch.is_complex returns the result for the whole tensor, not element-wise
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.
wow. that is a really annoying difference. but that is what it is
sanitation.sanitize_in(x) | ||
|
||
if issubclass(x.dtype, _complexfloating): | ||
return x.imag != 0 | ||
else: | ||
return factories.zeros(x.shape, bool, split=x.split, device=x.device, comm=x.comm) |
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.
wow. that is a really annoying difference. but that is what it is
Description
Add iscomplex() and isreal() functionality that checks element-wise for complex or real values.
Issue/s resolved: #737
Changes proposed:
Type of change
Due Diligence
Does this change modify the behaviour of other functions? If so, which?
no