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)