class_docstr: GlobalAveragePooling2D in tf <= 2.5.0 doesn't support keepdims.
code: def call(self, inputs):
      if not self._compat:
          return super(CompatGlobalAveragePooling2D, self).call(inputs)
  
      if self.data_format == "channels_last":
          return keras.backend.mean(
              inputs, axis=[1, 2], keepdims=self.keepdims
          )
      else:
          return keras.backend.mean(
              inputs, axis=[2, 3], keepdims=self.keepdims
          )
  
imports: import distutils.version
  import tensorflow
  from tensorflow_model_optimization.python.core.sparsity.keras import prune
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_policy
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_schedule
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_wrapper
label_desc: Use image node_id 2 for calling the CompatGlobalAveragePooling2D obj's underlying member method code with example usage: obj.call(inputs) and returns: super, keras, keras