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(布尔值)- 可选地进行原地操作。默认: False 形状: 输入: (∗)(*)(∗) ,其中 ∗*∗ 表示任意数量的维度。 输出: (∗)(*)(∗) ,与输入具有相同的形状。 示例: >>> m = nn.ReLU6() >>> input = torch.randn(2) >>> output = m(input)