Now, I have a matrix A, whose size is N * N. Now, I want to decomposition A to A = L+T, where L is the lower triangular part of A and T is the strictly upper triangular part of A. How can I do this?

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)

Anyway:

Cholesky pytorch function:

torch.potrf(A)

potrf docs:

https://pytorch.org/docs/stable/torch.html#torch.potrf