评价此页

ReLU6#

class torch.nn.ReLU6(inplace=False)[源代码]#

逐元素应用 ReLU6 函数。

ReLU6(x)=min(max(0,x),6)\text{ReLU6}(x) = \min(\max(0,x), 6)
参数

inplace (bool) – 可以选择是否就地执行操作。默认值:False

形状
  • 输入: ()(*),其中 * 表示任意数量的维度。

  • 输出: ()(*),形状与输入相同。

../_images/ReLU6.png

示例

>>> m = nn.ReLU6()
>>> input = torch.randn(2)
>>> output = m(input)
extra_repr()[源代码]#

返回模块的额外表示。

返回类型

str