- class paddle.nn.quant. Stub ( observer=None )
The stub is used as placeholders that will be replaced by observers before PTQ or QAT. It is hard to assign a quantization configuration to a functional API called in the forward of a layer. Instead, we can create a stub and add it to the sublayers of the layer. And call the stub before the functional API in the forward. The observer held by the stub will observe or quantize the inputs of the functional API. :param observer: :type observer: QuanterFactory :param It will use a global configuration to create the observers if the ‘observer’ is none.:
Defines the computation performed at every call. Should be overridden by all subclasses.
*inputs (tuple) – unpacked tuple arguments
**kwargs (dict) – unpacked dict arguments
- forward ( input )