mlx.core.linalg.det#
- det(a: array, *, stream: None | Stream | Device = None) array#
Compute the determinant of a square matrix.
This function supports arrays with at least 2 dimensions. When the input has more than two dimensions, the determinant is computed for each matrix in the last two dimensions.
- 参数:
- 返回:
The determinant(s) of the input matrix (matrices).
- 返回类型:
示例
>>> A = mx.array([[1., 2.], [3., 4.]]) >>> mx.linalg.det(A, stream=mx.cpu) array(-2, dtype=float32)