QuantizationTransformPassV2

class paddle.fluid.contrib.slim.quantization.quantization_pass. QuantizationTransformPassV2 ( 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 ) [source]

Quantize the ops that have weights. Add quant and dequant ops for the quantized ops’s inputs. It is used in the new format of quantization.

apply ( graph )

apply

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.

Parameters

graph (IrGraph) – the applied graph.

Returns

None