評價此頁

ReLU6#

class torch.nn.ReLU6(inplace=False)[原始碼]#

逐元素應用 ReLU6 函式。

ReLU6(x)=min(max(0,x),6)\text{ReLU6}(x) = \min(\max(0,x), 6)
引數

inplace (bool) – 可以選擇是否就地執行操作。預設值:False

形狀
  • 輸入: ()(*),其中 * 表示任意數量的維度。

  • 輸出: ()(*),形狀與輸入相同。

../_images/ReLU6.png

示例

>>> m = nn.ReLU6()
>>> input = torch.randn(2)
>>> output = m(input)
extra_repr()[原始碼]#

返回模組的額外表示。

返回型別

str