- class paddle.fluid.contrib.slim.quantization.quantization_pass. QuantizationTransformPass ( scope=None, place=None, weight_bits=8, activation_bits=8, activation_quantize_type='abs_max', weight_quantize_type='abs_max', window_size=10000, moving_rate=0.9, skip_pattern=['skip_quant'], quantizable_op_type=['conv2d', 'depthwise_conv2d', 'mul'], weight_quantize_func=None, act_quantize_func=None, weight_preprocess_func=None, act_preprocess_func=None, optimizer_func=None, executor=None, is_test=None )
Quantize the ops that have weights. Add quant and dequant ops for the quantized ops’s inputs.
Quantize the graph for training process. According to weight and activation quantization type, the graph will be added some fake quantize operators and fake dequantize operators.
graph (IrGraph) – the applied graph.
- apply ( graph )