mlx.core.linalg.tri_inv

目录

mlx.core.linalg.tri_inv#

tri_inv(a: array, upper: bool = False, *, stream: None | Stream | Device = None) array#

Compute the inverse of a triangular square matrix.

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.

  • upper (bool, optional) -- Whether the array is upper or lower triangular. Defaults to False.

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

返回:

ainv such that dot(a, ainv) = dot(ainv, a) = eye(a.shape[0])

返回类型:

array