Closed
Description
🐛 Describe the bug
Similar with #71384, based on the documentation of torch.linalg.inv
, torch.linalg.solve(A, B) == A.inv() @ B
. But there some some conterexamples:
import torch
A = torch.rand([2, 3, 3], dtype=torch.float64)
B = torch.rand([2, 3], dtype=torch.float64)
print(torch.linalg.solve(A, B))
# succeed
torch.linalg.inv(A) @ B
# RuntimeError: mat1 and mat2 shapes cannot be multiplied (6x3 and 2x3)
Versions
pytorch: 1.10.1
cc @brianjo @mruberry @jianyuh @nikitaved @pearu @walterddr @IvanYashchuk @xwang233 @lezcano