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)