Observer¶
- class Observer(dtype, **kwargs)[source]¶
A base class for Observer Module. Used to record input tensor’s statistics for quantization.
- Parameters
dtype (
Union[str,QuantDtypeMeta]) – a string indicating which dtype to collect scale and zero_point of.
- train(mode=True, recursive=True)[source]¶
Sets training mode of all the modules within this module (including itself) to
mode. This effectively sets thetrainingattributes of those modules tomode, but only has effect on certain modules (e.g.BatchNorm2d,Dropout,Observer)