Then I’d say you can use torch. solve
https://pytorch.org/docs/stable/torch.html#torch.solve 590
It works with batch, thus, in the worst case, you can reshape your matrix to create a batch and to pose the problem that way.
Obviously it depends on the method you want to use, the best you can do is to code it your self if you have a custom one based on pytorch functions.