How to use Pytorch LinAlg Solver?
I'm trying to replicate the first example on https://pytorch.org/docs/stable/generated/torch.linalg.solve.html
import torch
import time


Acuda = torch.randn(2,3,3,device='cuda')
bcuda = torch.randn(2,3,4,device='cuda')


t1 = time.time()
torch.linalg.torch.solve(Acuda,bcuda)

print('torch took: ',time.time()-t1)

As result I'm getting
Traceback (most recent call last):
 File &quot;linalg_solver_test.py&quot;, line 10, in &lt;module&gt;
     torch.linalg.torch.solve(Acuda,bcuda) 
     RuntimeError: A must be batches of square matrices, but they are 4 by 3 matrices

My Pytorch Version is 1.7.1.
In contray to the example on the documentation page, I'm using torch.linalg.torch.solve
as torch.linalg.solve does not exist.

You should use the latest PyTorch 1.9 for LinAlg, because it explicitly mentions &quot;Major improvements to support scientific computing, including torch.linalg&quot; (https://github.com/pytorch/pytorch/releases/tag/v1.9.0)
PyTorch 1.7.1 is rather old. Looks like this version's LinAlg solver doesn't support non-square matrices.
