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

35 lines
1.8 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.cond
==================
.. py:function:: mindspore.ops.cond(A, p=None)
返回给定Tensor的矩阵范数或向量范数。
`p` 为norm的计算模式。支持下列norm模式。
================= ================================== ==============================================
`p` 矩阵范数 向量范数
================= ================================== ==============================================
``None`` (默认值) `2`-norm (参考最下方公式) `2`-norm (参考最下方公式)
``'fro'`` Frobenius norm 不支持
``'nuc'`` nuclear norm 不支持
``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`` 不支持 :math:`sum(x != 0)`
``1`` :math:`max(sum(abs(x), dim=0))` 参考最下方公式
``-1`` :math:`min(sum(abs(x), dim=0))` 参考最下方公式
``2`` 最大奇异值 参考最下方公式
``-2`` 最小奇异值 参考最下方公式
其余int或float值 不支持 :math:`sum(abs(x)^{p})^{(1 / p)}`
================= ================================== ==============================================
.. note::
当前暂不支持复数。
参数:
- **A** (Tensor) - 是零个或多个batch维。
- **p** (Union[int, float, inf, -inf, 'fro', 'nuc'], 可选) - norm的模式参考上表默认 ``None``
返回:
Tensor