快捷鍵

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) – 選擇性地進行原地 (in-place) 操作。預設值:False

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

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

../_images/ReLU6.png

範例

>>> m = nn.ReLU6()
>>> input = torch.randn(2)
>>> output = m(input)

文件

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources