mindspore.ops.slogdet

mindspore.ops.slogdet(input)[source]

Computes the sign and the log of the absolute value of the determinant of one or more square matrices.

Note

The type of output always be real-value, even input is complex.

Parameters

input (Tensor) – The input tensor, shape is \((..., M, M)\).

Returns

Tuple of 2 tensors which are sign and the log of the absolute value.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> input = mindspore.tensor([[1., 2], [3, 4]])
>>> sign, value = mindspore.ops.slogdet(input)
>>> print(sign)
-1.0
>>> print(value)
0.6931472
>>> input = mindspore.tensor([[[-4.5, -1.5], [7.0, 6.0]], [[2.5, 0.5], [3.0, 9.0]]])
>>> sign, value = mindspore.ops.slogdet(input)
>>> print(sign)
[-1.  1.]
>>> print(value)
[2.8033605 3.0445223]