neural_compressor.tensorflow.quantization.config
Intel Neural Compressor TF quantization config API.
Classes
Config class for tf static quantization. |
|
Config class for tf smooth quantization. |
Functions
|
Generate the default static quant config. |
|
Generate the default rtn config. |
Module Contents
- class neural_compressor.tensorflow.quantization.config.StaticQuantConfig(weight_dtype: str = 'int8', weight_sym: bool = True, weight_granularity: str = 'per_tensor', weight_algorithm: str = 'minmax', act_dtype: str = 'int8', act_sym: bool = True, act_granularity: str = 'per_tensor', act_algorithm: str = 'minmax', white_list: List[neural_compressor.common.base_config.OP_NAME_OR_MODULE_TYPE] | None = DEFAULT_WHITE_LIST)[source]
Config class for tf static quantization.
- neural_compressor.tensorflow.quantization.config.get_default_static_quant_config() StaticQuantConfig [source]
Generate the default static quant config.
- Returns:
the default tf config.
- class neural_compressor.tensorflow.quantization.config.SmoothQuantConfig(alpha: float = 0.5, folding: bool = False, percentile: float = 99.999, op_types: list = ['MatMul', 'Conv2D'], scales_per_op: bool = True, record_max_info: bool = False, weight_clip: bool = True, auto_alpha_args: Dict = DEFAULT_SQ_ALPHA_ARGS, white_list: List[neural_compressor.common.base_config.OP_NAME_OR_MODULE_TYPE] | None = DEFAULT_WHITE_LIST)[source]
Config class for tf smooth quantization.
- neural_compressor.tensorflow.quantization.config.get_default_sq_config() SmoothQuantConfig [source]
Generate the default rtn config.
- Returns:
the default smooth quant config.