yamle.quantization.quantizer module#
- class yamle.quantization.quantizer.BaseQuantizer(activation_bits, weight_bits)[source]#
Bases:
ABCThis is the base class for all quantization methods.
The quantizer’s call method will be used to quantize the model.
- Parameters:
- abstract prepare(*args, **kwargs)[source]#
This method is used to prepare the model for quantization.
- Return type:
None
- abstract get_qconfig()[source]#
This method is used to get the quantization configuration.
- Return type:
Any
- cleanup(*args, **kwargs)[source]#
This method is used to clean up the model after quantization.
- Return type:
None
- save_original_model(method)[source]#
This method is used to create a copy of the original model.
- Return type:
None
- save_quantized_model(method)[source]#
This method is used to save the quantized model.
- Return type:
None
- class yamle.quantization.quantizer.DummyQuantizer(activation_bits, weight_bits)[source]#
Bases:
BaseQuantizerThis is a dummy quantizer that does not perform any quantization.