QuantizeTranspiler

class paddle.fluid.contrib.quantize.quantize_transpiler. QuantizeTranspiler ( weight_bits=8, activation_bits=8, activation_quantize_type='abs_max', weight_quantize_type='abs_max', window_size=10000, moving_rate=0.9 ) [source]
training_transpile ( program=None, startup_program=None )

training_transpile

Rewrites a training input program in place for simulated quantization. Insert fake quantization and de-quantization ops into program to simulate the error introduced by quantization. And change the gradient ops’ input by using the faked quantization weights and activation. Since the program is transformed in place, the graph connection will change.

Parameters

program (Program) – the input program to be transpile.

freeze_program ( program, place, scope=None )

freeze_program

Freeze input training program for inference.

Parameters

program (Program) – the input program to be transpile.