from tensorflow.python.ops import array_ops

      quantizer: `Quantizer` used to quantize tensors.
      **kwargs: Additional keyword arguments to be passed to the keras layer.
    """
    super(VitisGlobalAveragePooling2D, self).__init__(**kwargs)

  def build(self, input_shape):
    super(VitisGlobalAveragePooling2D, self).build(input_shape)

  def call(self, inputs):
    outputs = super(VitisGlobalAveragePooling2D, self).call(inputs)

    # Simulate DPU hahavior of AvgPooling
    input_shape = array_ops.shape(inputs)
    rescale_factor = _get_avgpool_scale(input_shape[1], input_shape[2])

    if rescale_factor != 1.0:
      outputs *= rescale_factor
    return outputs


@register_keras_serializable(package='Vitis', name='AveragePooling2D')
class VitisAveragePooling2D(tf.keras.layers.AveragePooling2D):
  """Vitis version of AveragePooling2D layer.

