neural_compressor.tensorflow.keras.layers.pool2d

Initialize custom pool2d layers for Keras quantization.

Classes

QAvgPool2D

The custom quantized AveragePooling2D layer.

QMaxPool2D

The custom quantized MaxPooling2D layer.

Functions

initialize_int8_avgpool(fp32_layer, q_config)

Initialize int8 avgpool.

initialize_int8_maxpool(fp32_layer, q_config)

Initialize int8 maxpool.

Module Contents

class neural_compressor.tensorflow.keras.layers.pool2d.QAvgPool2D(name, pool_size=(2, 2), strides=None, padding='valid', data_format=None, act_min_value=None, act_max_value=None, weight_min_value=None, weight_max_value=None, granularity='per_tensor', quant_status='calib', quant_mode='SCALED', quant_T='s8', quant_round_mode='HALF_AWAY_FROM_ZERO', quant_narrow_range=False, quant_axis=None, **kwargs)[source]

The custom quantized AveragePooling2D layer.

class neural_compressor.tensorflow.keras.layers.pool2d.QMaxPool2D(name, pool_size=(2, 2), strides=None, padding='valid', data_format=None, act_min_value=None, act_max_value=None, weight_min_value=None, weight_max_value=None, granularity='per_tensor', quant_status='calib', quant_mode='SCALED', quant_T='s8', quant_round_mode='HALF_AWAY_FROM_ZERO', quant_narrow_range=False, quant_axis=None, **kwargs)[source]

The custom quantized MaxPooling2D layer.

neural_compressor.tensorflow.keras.layers.pool2d.initialize_int8_avgpool(fp32_layer, q_config)[source]

Initialize int8 avgpool.

neural_compressor.tensorflow.keras.layers.pool2d.initialize_int8_maxpool(fp32_layer, q_config)[source]

Initialize int8 maxpool.