torch.ao.quantization.observer._ObserverBase#
- class torch.ao.quantization.observer._ObserverBase(dtype=torch.quint8, qscheme=torch.per_tensor_affine, reduce_range=False, quant_min=None, quant_max=None, factory_kwargs=None)[源代码]#
Internal common base for all qint/quint8 observers.
This base is for commonly used parameters used internally. Users should use ~torch.ao.quantization.observer.ObserverBase as a base class for custom observers.
- 参数
dtype – Quantized data type.
qscheme – Quantization scheme to be used.
reduce_range – Reduces the range of the quantized data type by 1 bit. This is sometimes required to avoid instruction overflow.
quant_min – Minimum quantization value. If unspecified, it will follow the 8-bit setup.
quant_max – Maximum quantization value. If unspecified, it will follow the 8-bit setup.
警告
dtype
can only taketorch.qint8
ortorch.quint8
.警告
qscheme
can only take one of the following options:torch.per_tensor_affine
torch.per_tensor_symmetric
torch.per_channel_affine
torch.per_channel_symmetric