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

22 lines
675 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.relu6
====================
.. py:function:: mindspore.ops.relu6(x)
计算输入Tensor的ReLU修正线性单元其上限为6。
.. math::
\text{ReLU6}(x) = \min(\max(0,x), 6)
返回 :math:`\min(\max(0,x), 6)` 元素的值。
参数:
- **x** (Tensor) - relu6的输入shape :math:`(N, *)` ,其中 :math:`*` 表示任意数量的附加维度数据类型为float16或float32。
返回:
Tensor数据类型和shape与 `x` 相同。
异常:
- **TypeError** - 如果 `x` 的数据类型既不是float16也不是float32。
- **TypeError** - 如果 `x` 不是Tensor。