mindspore/docs/api/api_python/ops/mindspore.ops.MatrixSolve.rst

27 lines
1.3 KiB
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.MatrixSolve
=========================
.. py:class:: mindspore.ops.MatrixSolve(adjoint=False)
求解线性方程组。
参数:
- **adjoint** (bool可选) - 指明是用矩阵求解还是用其逐块伴随求解。默认值False。
输入:
- **matrix** (Tensor) - Tensor线性方程组系数组成的矩阵其shape为 :math:`[..., M, M]`
- **rhs** (Tensor) - Tensor线性方程组结果值组成的矩阵其shape为 :math:`[..., M, K]` `rhs``matrix` 的类型必须一致。
输出:
Tensor线性方程组解组成的矩阵`rhs` 的shape及类型均相同。
异常:
- **TypeError** - 如果 `adjoint` 不是bool型。
- **TypeError** - 如果 `matrix` 的类型不是以下之一:
mstype.float16、mstype.float32、mstype.float64、mstype.complex64、mstype.complex128。
- **TypeError** - 如果 `rhs``matrix` 的类型不一致。
- **ValueError** - 如果 `matrix` 的秩小于2。
- **ValueError** - 如果 `matrix``rhs` 的维度不同。
- **ValueError** - 如果 `matrix` 的最内两维不同。
- **ValueError** - 如果 `rhs` 的最内两维与 `matrix` 不匹配。