快捷方式

ReLU6

class torch.ao.nn.quantized.ReLU6(inplace=False)[source][source]

應用逐元素函式

ReLU6(x)=min((x0,x),q(6))\text{ReLU6}(x) = \min(\max(x_0, x), q(6)),其中 x0x_0 是零點,q(6)q(6) 是數字 6 的量化表示。

引數

inplace (bool) – 可選地執行原地操作。預設值:False

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

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

../_images/ReLU6.png

示例

>>> m = nn.quantized.ReLU6()
>>> input = torch.randn(2)
>>> input = torch.quantize_per_tensor(input, 1.0, 0, dtype=torch.qint32)
>>> output = m(input)

文件

訪問 PyTorch 的完整開發者文件

檢視文件

教程

獲取適合初學者和高階開發者的深入教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源