ReLU6¶
- class torch.ao.nn.quantized.ReLU6(inplace=False)[source][source]¶
應用逐元素函式
,其中 是零點, 是數字 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)