modify format

This commit is contained in:
huodagu 2023-01-20 11:45:04 +08:00
parent 9e0108a31a
commit b8dcbdbde3
6 changed files with 22 additions and 26 deletions

View File

@ -20,7 +20,6 @@
异常:
- **TypeError** - `op``group` 不是str或者输入的数据类型是bool。
- **ValueError** - `op` 为"prod"。
样例:

View File

@ -28,13 +28,10 @@ mindspore.ops.norm
- **ord** (Union[int, float, inf, -inf, 'fro', 'nuc'], 可选) - norm的模式。行为参考上表。默认值None。
- **dim** (Union[int, Tuple(int)], 可选) - 计算向量范数或矩阵范数的维度。默认值None。
- 当 `dim` 为int时会按向量范数计算。
- 当 `dim` 为一个二元组时,会按矩阵范数计算。
- 当 `dim` 为None且 `ord` 为None`A` 将会被展平为1D并计算向量的2-范数。
- 当 `dim` 为None且 `ord` 不为None`A` 必须为1D或者2D。
- 当 `dim` 为int时会按向量范数计算。
- 当 `dim` 为一个二元组时,会按矩阵范数计算。
- 当 `dim` 为None且 `ord` 为None`A` 将会被展平为1D并计算向量的2-范数。
- 当 `dim` 为None且 `ord` 不为None`A` 必须为1D或者2D。
- **keepdim** (bool) - 输出Tensor是否保留原有的维度。默认值False。

View File

@ -5640,7 +5640,7 @@ def topk(input_x, k, dim=None, largest=True, sorted=True):
k (int): The number of top or bottom elements to be computed along the last dimension, constant input is needed.
dim (int, optional): The dimension to sort along. Default: None.
largest (bool, optional): If largest is False then the k smallest elements are returned. Default: True.
sorted (bool): If True, the obtained elements will be sorted by the values in descending order.
sorted (bool, optional): If True, the obtained elements will be sorted by the values in descending order.
If False, the obtained elements will be sorted by the values in ascending order. Default: True.
Returns:

View File

@ -101,7 +101,7 @@ def pinv(x, *, atol=None, rtol=None, hermitian=False):
atol or rtol is float.
If atol or rtol is a Tensor, its shape must be broadcast to the singular value returned by
`x.svd <https://www.mindspore.cn/docs/en/master/api_python/ops/mindspore.ops.svd.html>`_ .
If x.shape is :math:`(B, M, N)`, and the shape of atol or rtol is :math: `(K, B)`, the output
If x.shape is :math:`(B, M, N)`, and the shape of atol or rtol is :math:`(K, B)`, the output
shape is :math:`(K, B, N, M)`.
When the Hermitian is True, temporary support only real domain, x is treated as a real symmetric, so x is
not checked internally, and only use the lower triangular part in the computations.

View File

@ -7214,21 +7214,21 @@ def norm(A, ord=None, dim=None, keepdim=False, *, dtype=None):
`ord` is the calculation mode of norm. The following norm modes are supported.
====================== ========================= ========================================================
`ord` norm for matrices norm for vectors
====================== ========================= ========================================================
`None` (default) Frobenius norm `2`-norm (see below)
`'fro'` Frobenius norm -- not supported --
`'nuc'` nuclear norm -- not supported --
`inf` :math:`max(sum(abs(x), dim=1))` :math:`max(abs(x))`
`-inf` :math:`min(sum(abs(x), dim=1))` :math:`min(abs(x))`
`0` -- not supported -- :math:`sum(x != 0)`
`1` :math:`max(sum(abs(x), dim=0))` as below
`-1` :math:`min(sum(abs(x), dim=0))` as below
`2` largest singular value as below
`-2` smallest singular value as below
other `int` or `float` -- not supported -- :math:`sum(abs(x)^{ord})^{(1 / ord)}`
====================== ========================= ========================================================
====================== ================================ ==========================================
`ord` norm for matrices norm for vectors
====================== ================================ ==========================================
`None` (default) Frobenius norm `2`-norm (see below)
`'fro'` Frobenius norm -- not supported --
`'nuc'` nuclear norm -- not supported --
`inf` :math:`max(sum(abs(x), dim=1))` :math:`max(abs(x))`
`-inf` :math:`min(sum(abs(x), dim=1))` :math:`min(abs(x))`
`0` -- not supported -- :math:`sum(x != 0)`
`1` :math:`max(sum(abs(x), dim=0))` as below
`-1` :math:`min(sum(abs(x), dim=0))` as below
`2` largest singular value as below
`-2` smallest singular value as below
other `int` or `float` -- not supported -- :math:`sum(abs(x)^{ord})^{(1 / ord)}`
====================== ================================ ==========================================
Args:
A (Tensor): Tensor of shape :math:`(*, n)` or :math:`(*, m, n)` where * is zero or more batch dimensions.

View File

@ -7822,7 +7822,7 @@ class TopK(Primitive):
If the two compared elements are the same, the one with the smaller index value is returned first.
Args:
sorted (bool): If True, the obtained elements will be sorted by the values in descending order.
sorted (bool, optional): If True, the obtained elements will be sorted by the values in descending order.
If False, the obtained elements will be sorted by the values in ascending order. Default: True.
Inputs: