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