mindspore/docs/api/api_python/ops/mindspore.ops.func_hardsigm...

32 lines
778 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.hardsigmoid
=========================
.. py:function:: mindspore.ops.hardsigmoid(input)
Hard Sigmoid激活函数。按元素计算输出。
Hard Sigmoid定义为
.. math::
\text{HardSigmoid}(input) =
\begin{cases}
0, & \text{ if } input \leq -3, \\
1, & \text{ if } input \geq +3, \\
input/6 + 1/2, & \text{ otherwise }
\end{cases}
HardSigmoid函数图
.. image:: ../images/Hardsigmoid.png
:align: center
参数:
- **input** (Tensor) - 输入Tensor。
返回:
Tensorshape和数据类型与输入 `input` 相同。
异常:
- **TypeError** - `input` 不是Tensor。
- **TypeError** - `input` 不是int或者float类型。