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

23 lines
577 B
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.sign
===================
.. py:function:: mindspore.ops.sign(input)
按sign公式逐元素计算输入tensor。
.. math::
\text{out}_{i} = \begin{cases}
-1 & \text{input}_{i} < 0 \\
0 & \text{input}_{i} = 0 \\
1 & \text{input}_{i} > 0
\end{cases}
.. note::
在输入为NaN且数据类型为float64时该算子计算结果为NaN。
参数:
- **input** (Tensor) - 输入tensor。
返回:
Tensor