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

32 lines
1.9 KiB
ReStructuredText
Raw Permalink Normal View History

2022-11-10 16:51:47 +08:00
mindspore.ops.LuSolve
=====================
.. py:class:: mindspore.ops.LuSolve
返回线性方程组 :math:`Ax = b` 的解。
.. note::
`lu_pivots` 的batch维度必须与 `lu_data` 的batch维度相匹配且batch维度的大小和每个维度的值必须相同。
例如, `lu_data`:math:`(3, 3, 2, 2)` `lu_pivots`:math:`(3, 3, 2)` `lu_data`
的batch维度为 :math:`(3, 3)` `lu_pivots` 的batch维度为 :math:`(3, 3)`
`lu_data` 的batch维度必须与 `x` 的batch维度匹配batch维度可以具有不同的尺寸从右到左对应的维度必须相等。
例如, `lu_data`:math:`(3, 3, 2, 2)` `x`:math:`(2, 3, 3, 2, 2, 1)`
`lu_data` 的batch维度为 :math:`(3, 3)` `x` 的batch维度为 :math:`(2, 3, 3)`
输入:
- **x** (Tensor) - Tensorshape为 :math:`(*, m, k)` ,其中 :math:`*` 为batch维度数据类型float32、float16。
- **lu_data** (Tensor) - Tensorshape为 :math:`(*, m, m)` ,其中 :math:`*` 为batch维度可以分解成一个上三角矩阵U和一个下三角矩阵L数据类型为float32、float16。
- **lu_pivots** (Tensor) - Tensorshape为 :math:`(*, m)` ,其中 :math:`*` 为batch维度可以转换成一个置换矩阵P数据类型int32。
输出:
Tensor数据类型与 `x``lu_data` 相同。
异常:
- **TypeError** - 若 `x``lu_data` 的数据类型不是float32或float16。
- **TypeError** - 若 `lu_data` 的数据类型不是int32。
- **TypeError** - 若 `x``lu_data``lu_pivots` 不是Tensor。
- **TypeError** - 若 `x``lu_data` 的数据类型不同。
- **ValueError** - 若 `lu_pivots` 的batch维度与 `lu_data` 的batch维度不匹配。
- **ValueError** - 若 `x` 的维度小于2 `lu_data` 的维度小于2或 `lu_pivots` 的维度小于1。