mindspore2022/docs/api/api_python/nn/mindspore.nn.ReLU6.rst

23 lines
573 B
ReStructuredText
Raw 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.nn.ReLU6
===================
.. py:class:: mindspore.nn.ReLU6
ReLU6激活函数。
ReLU6类似于ReLU不同之处在于设置了上限其上限为6如果输入大于6输出会被限制为6。公式如下
.. math::
Y = \min(\max(0, x), 6).
**输入:**
- **x** (Tensor) - ReLU6的输入任意维度的Tensor其数据类型为float16或float32。
**输出:**
Tensor数据类型与 `x` 相同。
**异常:**
- **TypeError** - `x` 的数据类型既不是float16也不是float32。