mindspore.nn.MatDet
- class mindspore.nn.MatDet[source]
Calculates the determinant of Positive-Definite Hermitian matrix using Cholesky decomposition.
- Inputs:
a (Tensor[Number]) - The input tensor. It must be a positive-definite matrix. With float16 or float32 data type.
- Outputs:
Tensor, has the same dtype as the a.
- Raises
TypeError – If dtype of a is neither float16 nor float32.
- Supported Platforms:
GPU
Examples
>>> input_a = Tensor(np.array([[4, 12, -16], [12, 37, -43], [-16, -43, 98]]).astype(np.float32)) >>> op = nn.MatDet() >>> output = op(input_a) >>> print(output) 35.999996