-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Adds torch.linalg namespace #42664
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
Adds torch.linalg namespace #42664
Conversation
💊 CI failures summary and remediationsAs of commit 962dec2 (more details on the Dr. CI page):
1 job timed out:
ci.pytorch.org: 2 failed
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 or post in the (internal) Dr. CI Users group. This comment has been revised 9 times. |
|
Here is the reference page for numpy.linalg. The equivalent pytorch functions:
Should I move this to a tracking issue? |
|
@mattip A tracking issue with those functions would be great! |
torch/linalg/__init__.py
Outdated
| Tensor = torch.Tensor | ||
|
|
||
| # Note: This not only adds the doc strings for the spectral ops, but | ||
| # connects the torch.fft Python namespace to the torch._C._fft builtins. |
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.
| # connects the torch.fft Python namespace to the torch._C._fft builtins. | |
| # connects the torch.linalg Python namespace to the torch._C._linalg builtins. |
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.
Great catch! Thank you, @kurtamohler!
facebook-github-bot
left a comment
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.
@mruberry has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
This PR adds the
torch.linalgnamespace as part of our continued effort to be more compatible with NumPy. The namespace is tested by adding a single function,torch.linalg.outer, and testing it in a new test suite, test_linalg.py. It follows the same pattern that #41911, which added thetorch.fftnamespace, did.Future PRs will likely:
torch.linalgin preference to the new namespace