mlx.core.linalg.pinv

目录

mlx.core.linalg.pinv#

pinv(a: array, *, stream: None | Stream | Device = None) array#

Compute the (Moore-Penrose) pseudo-inverse of a matrix.

This function calculates a generalized inverse of a matrix using its singular-value decomposition. This function supports arrays with at least 2 dimensions. When the input has more than two dimensions, the inverse is computed for each matrix in the last two dimensions of a.

参数:
  • a (array) -- Input array.

  • stream (Stream, optional) -- Stream or device. Defaults to None in which case the default stream of the default device is used.

返回:

aplus such that a @ aplus @ a = a

返回类型:

array