ReLU6¶
- class torch.ao.nn.quantized.ReLU6(inplace=False)[source][source]¶
应用逐元素函数:
,其中 是零点, 是数字 6 的量化表示。
- 参数:
inplace(布尔值)- 可选地进行原地操作。默认:
False
- 形状:
输入: 其中 * 表示任意数量的额外维度
输出: ,与输入具有相同的形状
示例:
>>> m = nn.quantized.ReLU6() >>> input = torch.randn(2) >>> input = torch.quantize_per_tensor(input, 1.0, 0, dtype=torch.qint32) >>> output = m(input)