功能性 ¶
- class torch.ao.nn.quantized.QFunctional[source][source]¶
量化操作的包装类。
该类的实例可以用作替代
torch.ops.quantized
前缀。下面是示例用法。注意
该类不提供
forward
钩子。相反,您必须使用底层函数之一(例如add
)。示例:
>>> q_add = QFunctional() >>> a = torch.quantize_per_tensor(torch.tensor(3.0), 1.0, 0, torch.qint32) >>> b = torch.quantize_per_tensor(torch.tensor(4.0), 1.0, 0, torch.qint32) >>> q_add.add(a, b) # Equivalent to ``torch.ops.quantized.add(a, b, 1.0, 0)``
- 有效的操作名称:
添加
猫
多
添加 ReLU
添加标量
多标量