cupy.linalg.pinv#

cupy.linalg.pinv(a, rcond=1e-15)[source]#

Compute the Moore-Penrose pseudoinverse of a matrix.

It computes a pseudoinverse of a matrix a, which is a generalization of the inverse matrix with Singular Value Decomposition (SVD). Note that it automatically removes small singular values for stability.

Parameters:
  • a (cupy.ndarray) – The matrix with dimension (..., M, N)

  • rcond (float or cupy.ndarray) – Cutoff parameter for small singular values. For stability it computes the largest singular value denoted by s, and sets all singular values smaller than rcond * s to zero. Broadcasts against the stack of matrices.

Returns:

The pseudoinverse of a with dimension (..., N, M).

Return type:

cupy.ndarray

Warning

This function calls one or more cuSOLVER routine(s) which may yield invalid results if input conditions are not met. To detect these invalid results, you can set the linalg configuration to a value that is not ignore in cupyx.errstate() or cupyx.seterr().