There was an error while loading. Please reload this page.
module compress
compress模块用来做Quantization-Aware-Training(QAT)训练量化,提供了训练量化的接口
Quantization-Aware-Training(QAT)
compress.Feature_Scale_Method
对特征的量化方式,可以针对整个特征进行量化,也可以针对每个channel进行量化
Enum
PER_TENSOR
PER_CHANNEL
compress.Scale_Update_Method
scale的更新方式
MAXIMUM
MOVING_AVERAGE
train_quant(module, |quant_bits, feature_scale_method, scale_update_method)
训练量化
参数:
module
quant_bits
8
feature_scale_method
scale_update_method
返回:是否成功
返回类型:bool
bool
示例
# args are self-explained nn.compress.train_quant(module, quant_bits = 8, feature_scale_method = Feature_Scale_Method.PER_TENSOR, scale_update_method = Scale_Update_Method.MOVING_AVERAGE)