-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Refactor c10::complex and cleanup c10::Scalar #38593
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
Conversation
💊 CI failures summary and remediationsAs of commit 90a2372 (more details on the Dr. CI page): ✅ None of the CI failures appear to be your fault 💚
🚧 2 ongoing upstream failures:These were probably caused by upstream breakages that are not fixed yet:
This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker. This comment has been revised 1 time. |
using value_type = T; | ||
|
||
T storage[2] = {T(), T()}; | ||
T real_ = T(0); |
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.
nit: can we name them real
and imag
to keep it similar to the (TBA) python API
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.
No, there is already a method named real
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.
@anjali411 is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@anjali411 merged this pull request in 928ce29. |
@zasdfgbnm this PR was reverted because it broke master. The OSS ci was based on a branch that was 15 days old. |
Main:
c10::complex
is refactored: it no longer uses inheritance to specialize constructors, but using SFINAE instead. This implementation is cleaner and avoids some compiler bugs.c10::Scalar
is cleaned up: it no longer needs to store complex asdouble z[2]
,c10::complex<double>
will work.Other cleanups:
numeric_limits
ofc10::complex
is moved tocomplex_utils.h
c10::complex
storing real and imag is changed fromstorage[2]
toreal_
andimag_
c10::
beforecomplex
when inc10
namespace