mindspore.ops.matrix_solve
- mindspore.ops.matrix_solve(matrix, rhs, adjoint=False)[source]
Solves systems of linear equations.
\[\begin{split}\begin{aligned} &matrix[..., M, M] * x[..., M, K] = rhs[..., M, K]\\ &adjoint(matrix[..., M, M]) * x[..., M, K] = rhs[..., M, K] \end{aligned}\end{split}\]Warning
On GPU, if the matrix is irreversible, an error may be reported or an unknown result may be returned.
This interface is deprecated and will be removed after version 2.9.0.
- Parameters
- Returns
Tensor
- Supported Platforms:
AscendCPU
Examples
>>> import mindspore >>> matrix = mindspore.tensor([[5., 4.], [3., 1.]]) >>> rhs = mindspore.tensor([[7.], [2.]]) >>> result = mindspore.ops.matrix_solve(matrix, rhs) >>> print(result) [[0.14285707] [1.5714287 ]]