ReLU6 类torch.nn.ReLU6(inplace=False)[源代码] 元素级应用ReLU6函数。 $\text{ReLU6}(x) = \min(\max(0,x), 6)$ 参数 inplace (bool) – 是否以就地方式执行操作(可选)。默认值: False 形状: 输入: $(*)$,其中$*$表示任意维度的数量。 输出: $(*)$,形状与输入相同。 示例: >>> m = nn.ReLU6() >>> input = torch.randn(2) >>> output = m(input)