mindspore.mint.inverse
- mindspore.mint.inverse(input)[source]
Compute the inverse of the input matrix.
- Parameters
input (Tensor) – A matrix to be calculated. Input input must be at least 2-D, at most 6-D, and the size of the last two dimensions must be the same size. And the matrix must be invertible.
- Returns
Tensor, has the same type and shape as input input.
- Raises
ValueError – If the size of the last two dimensions of input is not the same.
ValueError – If input is not empty and its dimensions are less than 2.
ValueError – If the dimensions of input are larger than 6.
- Supported Platforms:
Ascend
Examples
>>> import mindspore >>> x = mindspore.tensor([[1., 2.], [3., 4.]], mindspore.float32) >>> print(mindspore.mint.inverse(x)) [[-2.0000002 1.0000001 ] [ 1.5000001 -0.50000006]]