I have to solve linear system with Variable matrix and then to compute gradients with respect to it.
Is there any way to perform this operation?
I think you’re looking for
Thanks a lot, it was rather hard to find this function!
gesv can only support the matrix A being square. Is it possible to solve linear system for non-square A in PyTorch?
Linear system for non-square is an overparametrized linar system which is solved by minimization, typically svd. Im not sure if it’s differentiable
For non-square A, you should look at gels, not gesv. https://pytorch.org/docs/stable/torch.html#torch.gels