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
Add torch.eig complex forward (CPU, CUDA) #49168
Closed
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
4786d9b
enable the first eig/complex test, which currently fails [ci skip]
antocuni 3809df9
prepare lapackEig to support complex types: instead of passing wr and…
antocuni a0034e8
progress: dispatch apply_eig also to complex types, and tweak things …
antocuni 5b2793d
WIP: implement lapackEig<complex<float>>, and the corresponding call …
antocuni e1daece
make sure that the shape of eigenvals is correct in the complex case
antocuni ab8ac04
add support for complex128
antocuni c731ac0
Merge remote-tracking branch 'upstream/master' into antocuni/eig-complex
antocuni e909de6
start to add CUDA support: change the signature of magmaEig to match …
antocuni 07db9c6
WIP, untested: implement magmaEig for complex types
antocuni 5080f88
add complext support for CUDA eig
antocuni e1c1ebe
kill the comment as the code already does what the XXX wanted. Use a …
antocuni 7f4060d
this is a much simpler way to check whether the tensor is complex
antocuni 8f69e27
Merge remote-tracking branch 'upstream/master' into antocuni/eig-complex
antocuni 01c168d
add a test to check what happens with eig on complex types
antocuni File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
As discussed in #43081, I think we should always return a complex tensor. This will be a bc breaking change, so we should only update this behavior for
torch.linalg.eig
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 thought that the point of
torch.linalg.*
was to be as compatible to numpy as possible. This would be an unnecessary breakage for people porting their code from numpy to pytorch.What about adding a flag such as
returns_complex=False
(or=True
if we want the correct-but-numpy-incompatible behavior by default) to let the user choose?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.
Hey, @antocuni , looks like Numpy is already doing 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.
ouch, my fault, I overlooked it. Ok, I'll implement the "proper" behavior then, thanks for pointing it out
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 @nikitaved I just realized that
torch.linalg.eig
doesn't exists yet!So I think that the current behavior of my branch is correct. I agree that
torch.linalg.eig
should always return complex, but I don't think there is anything we can do in this branch