ReLU6¶
- class torch.ao.nn.quantized.ReLU6(inplace=False)[源代码]¶
对每个元素应用函数:
, 其中 是零点,并且 是数字6的量化表示。
- Parameters
inplace (布尔值) – 可以选择就地执行操作。默认值:
False
- Shape:
输入: 其中 * 表示任意数量的额外维度
输出: , 与输入形状相同
示例:
>>> m = nn.quantized.ReLU6() >>> input = torch.randn(2) >>> input = torch.quantize_per_tensor(input, 1.0, 0, dtype=torch.qint32) >>> output = m(input)