keras/src/layers/pooling/base_global_pooling.py/BaseGlobalPooling/__init__
class BaseGlobalPooling:    def __init__(
        self, pool_dimensions, data_format=None, keepdims=False, **kwargs
    ):
        super().__init__(**kwargs)

        self.data_format = backend.standardize_data_format(data_format)
        self.keepdims = keepdims
        self.input_spec = InputSpec(ndim=pool_dimensions + 2)