torch.linalg.pinv
torch.linalg.pinv(A, *, atol=None, rtol=None, hermitian=False, out=None) -> Tensor
Computes the pseudoinverse (Moore-Penrose inverse) of a matrix.
The pseudoinverse may be defined algebraically but it is more
   computationally convenient to understand it through the SVD
Supports input of float, double, cfloat and cdouble dtypes. Also
   supports batches of matrices, and if "A" is a batch of matrices
   then the output has the same batch dimensions.
If "hermitian"= True, "A" is assumed to be Hermitian if complex
   or symmetric if real, but this is not checked internally. Instead,
   just the lower triangular part of the matrix is used in the
   computations.
The singular values (or the norm of the eigenvalues when
   "hermitian"= True) that are below \max(\text{atol}, \sigma_1
   \cdot \text{rtol}) threshold are treated as zero and discarded in
   the computation, where \sigma_1 is the largest singular value (or
   eigenvalue).