So you are looking to do LU decomposition, right? You can do that with two cholesky factorizations (see
http://www.alecjacobson.com/weblog/#article/2242 34)
Anyway:
Cholesky pytorch function:
torch.potrf(A)
potrf docs:
https://pytorch.org/docs/stable/torch.html#torch.potrf 70