ReLU6¶ class torch.nn.ReLU6(inplace=False)[source][source]¶ 逐元素应用 ReLU6 函数。 ReLU6(x)=min(,x),6)\text{ReLU6}(x) = \min(\max(0,x), 6) ReLU6(x)=min(max(0,x),6) 参数 inplace (bool) – 可选择是否就地(in-place)执行操作。默认值:False 形状 输入: (∗)(*)(∗),其中 ∗*∗ 表示任意数量的维度。 输出: (∗)(*)(∗),形状与输入相同。 示例 >>> m = nn.ReLU6() >>> input = torch.randn(2) >>> output = m(input)