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