# pinv¶

paddle.linalg. pinv ( x, rcond=1e-15, hermitian=False, name=None ) [source]

Calculate pseudo inverse via SVD(singular value decomposition) of one matrix or batches of regular matrix.

\[if hermitian == False: x = u * s * vt (SVD) out = v * 1/s * ut else: x = u * s * ut (eigh) out = u * 1/s * u.conj().transpose(-2,-1)\]

If x is hermitian or symmetric matrix, svd will be replaced with eigh.

Parameters
• x (Tensor) – The input tensor. Its shape should be (*, m, n) where * is zero or more batch dimensions. m and n can be arbitrary positive number. The data type of x should be float32 or float64 or complex64 or complex128. When data type is complex64 or complex128, hermitian should be set True.

• rcond (Tensor, optional) – the tolerance value to determine when is a singular value zero. Default:1e-15.

• hermitian (bool, optional) – indicates whether x is Hermitian if complex or symmetric if real. Default: False.

• name (str, optional) – The default value is None. Normally there is no need for user to set this property. For more information, please refer to Name.

Returns

The tensor with same data type with x. it represents pseudo inverse of x. Its shape should be (*, n, m).

Return type

Tensor

Examples

```>>> import paddle

>>> print(input)
[[0. , 1. , 2. , 3. , 4. ],
[5. , 6. , 7. , 8. , 9. ],
[10., 11., 12., 13., 14.]])

>>> print(out)