class_docstr: GlobalAveragePooling2D in tf <= 2.5.0 doesn't support keepdims.
code: def __init__(self, *args, keepdims=False, **kwargs):
      self._compat = False
      if version.LooseVersion(tf.__version__) > version.LooseVersion(
          "2.5.0"
      ):
          super(CompatGlobalAveragePooling2D, self).__init__(
              *args, keepdims=keepdims, **kwargs
          )
      else:
          super(CompatGlobalAveragePooling2D, self).__init__(
              *args, **kwargs
          )
          self._compat = True
          self.keepdims = 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 1 to create a new CompatGlobalAveragePooling2D object from inherited base classes: layers with example: obj = CompatGlobalAveragePooling2D()