-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Update parametrizations.py #2642
Conversation
For PyTorch 2, torch.solve => torch.linalg.solve
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/2642
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 61ccafe with merge base 3ac15b1 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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.
LGTM! Thanks for catching this.
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 warning correctly mentions, you need to change argument order
Co-authored-by: Svetlana Karslioglu <svekars@meta.com>
Add torch.solve as a removed function (I somehow missed it before and noticed after pytorch/tutorials#2642). Also added a mechanism to show reference links in the error messages.
Add torch.solve as a removed function (I somehow missed it before and noticed after pytorch/tutorials#2642). Also added a mechanism to show reference links in the error messages.
For PyTorch 2, torch.solve => torch.linalg.solve
Fixes #2641
Description
Code like
def forward(self, X):
# (I + X)(I - X)^{-1}
return torch.solve(self.Id + X, self.Id - X).solution
results in
RuntimeError: This function was deprecated since version 1.9 and is now removed. torch.solve is deprecated in favor of torch.linalg.solve. torch.linalg.solve has its arguments reversed and does not return the LU factorization.
Update to use
pytorch.linalg.solve
Checklist
cc @albanD @sekyondaMeta @svekars @carljparker @NicolasHug @kit1980 @subramen