add docs for exceptions and equations

This commit is contained in:
zhujingxuan 2022-07-06 16:36:53 +08:00
parent 3504d1ba48
commit b9f9529c8d
5 changed files with 22 additions and 1 deletions

View File

@ -292,7 +292,7 @@ mindspore.Tensor
**返回:**
Tensor。
Tensor数据类型和shape与 `x` 相同
.. py:method:: cummax(axis)

View File

@ -23,3 +23,5 @@ mindspore.ops.inplace_add
- **TypeError** - `indices` 不是int或tuple。
- **TypeError** - `indices` 是元组但是其中的元素不是int。
- **ValueError** - `x` 的维度与 `v` 的维度不相等。
- **ValueError** - `indices` 的长度与 `v.shape[0]` 不相等。
- **ValueError** - `indices` 的值不属于范围 `[0, x.shape[0])`

View File

@ -23,3 +23,5 @@ mindspore.ops.inplace_sub
- **TypeError** - `indices` 不是int或tuple。
- **TypeError** - `indices` 是元组但是其中的元素不是int。
- **ValueError** - `x` 的维度与 `v` 的维度不相等。
- **ValueError** - `indices` 的长度与 `v.shape[0]` 不相等。
- **ValueError** - `indices` 的值不属于范围 `[0, x.shape[0])`

View File

@ -5,6 +5,12 @@ mindspore.ops.matrix_solve
求解线性方程组。
.. math::
\begin{aligned}
&matrix[..., M, M] * x[..., M, K] = rhs[..., M, K]\\
&adjoint(matrix[..., M, M]) * x[..., M, K] = rhs[..., M, K]
\end{aligned}
**参数:**
- **matrix** (Tensor) - 输入Tensor shape 为 :math:`[..., M, M]`

View File

@ -889,6 +889,8 @@ def inplace_add(x, v, indices):
TypeError: If `indices` is neither int nor tuple.
TypeError: If `indices` is a tuple whose elements are not all int.
ValueError: If the rank of `x` is not equal to the rank of `v`.
ValueError: If the length of `indices` is not equal to `v.shape[0]`.
ValueError: If the values of `indices` are not in range of `[0, x.shape[0])`.
Supported Platforms:
``Ascend`` ``CPU``
@ -929,6 +931,8 @@ def inplace_sub(x, v, indices):
TypeError: If `indices` is neither int nor tuple.
TypeError: If `indices` is a tuple whose elements are not all int.
ValueError: If the rank of `x` is not equal to the rank of `v`.
ValueError: If the length of `indices` is not equal to `v.shape[0]`.
ValueError: If the values of `indices` are not in range of `[0, x.shape[0])`.
Supported Platforms:
``Ascend`` ``CPU``
@ -2093,6 +2097,13 @@ def matrix_solve(matrix, rhs, adjoint=False):
r"""
Solves systems of linear equations.
.. math::
\begin{aligned}
&matrix[..., M, M] * x[..., M, K] = rhs[..., M, K] \\
&adjoint(matrix[..., M, M]) * x[..., M, K] = rhs[..., M, K]
\end{aligned}
Args:
matrix (Tensor): The shape of tensor is :math:`[..., M, M]`.
rhs (Tensor): The shape of tensor is :math:`[..., M, K]`. `rhs` must have the same dtype as `matrix`.