forked from mindspore-Ecosystem/mindspore
modify format
This commit is contained in:
parent
9e0108a31a
commit
b8dcbdbde3
|
@ -20,7 +20,6 @@
|
|||
|
||||
异常:
|
||||
- **TypeError** - `op` 或 `group` 不是str,或者输入的数据类型是bool。
|
||||
- **ValueError** - `op` 为"prod"。
|
||||
|
||||
样例:
|
||||
|
||||
|
|
|
@ -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。
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue