ReLU6¶
- class torch.ao.nn.quantized.ReLU6(inplace=False)[來源][來源]¶
套用逐元素函數
, 其中 是 zero_point,而 是數字 6 的量化表示。
- 參數
inplace (bool) – 是否選擇性地就地執行運算。預設值:
False
- 形狀
輸入:,其中 * 代表任意數量的額外維度
輸出:,與輸入相同的形狀
範例
>>> m = nn.quantized.ReLU6() >>> input = torch.randn(2) >>> input = torch.quantize_per_tensor(input, 1.0, 0, dtype=torch.qint32) >>> output = m(input)