pytorch
849c6a52 - Extrapolated on equiv between linalg @ and solve (#71769)

Commit
2 years ago
Extrapolated on equiv between linalg @ and solve (#71769) Summary: Potentially fixes https://github.com/pytorch/pytorch/issues/71385 similar docstring could also fix https://github.com/pytorch/pytorch/issues/71384 Updated the doc to `torch.linalg.inv` to include nuance around equivalence to `torch.linalg.solve`: Update is below: ``` .. note:: Consider using :func:`torch.linalg.solve` if possible for multiplying a matrix on the left by the inverse, as:: linalg.solve(A, B) == linalg.inv(A) @ B # When B is a matrix It is always prefered to use :func:`~solve` when possible, as it is faster and more numerically stable than computing the inverse explicitly. ``` IvanYashchuk please inform if this the right direction or over-extrapolation. I can apply the same changes to the `tensorinv` doc to fix https://github.com/pytorch/pytorch/issues/71384. Also in https://github.com/pytorch/pytorch/issues/71384 there was a mention of updating `torch.matmul` error message to indicate the proper tensor shapes, I could also potentially do that in this PR if needed. Pull Request resolved: https://github.com/pytorch/pytorch/pull/71769 Reviewed By: H-Huang Differential Revision: D34242541 Pulled By: mruberry fbshipit-source-id: 40e98dad4d821928d1dea72d4512ee579b690a32 (cherry picked from commit a0321a5de9ddc5bbcd2203bba20cb6751e98f126)
Author
Committer
Parents
Loading