class_docstr: Pooling layer for arbitrary pooling functions, for 2D inputs (e.g. images).
  This class only exists for code reuse. It will never be an exposed API.
  Arguments:
    _pool_function: The pooling function to apply, e.g. `prot.max_pool2d`.
    pool_size: An integer or tuple/list of 2 integers: (pool_height, pool_width)
      specifying the size of the pooling window.
      Can be a single integer to specify the same value for
      all spatial dimensions.
    strides: An integer or tuple/list of 2 integers,
      specifying the strides of the pooling operation.
      Can be a single integer to specify the same value for
      all spatial dimensions.
    padding: A string. The padding method, either 'valid' or 'same'.
      Case-insensitive.
    data_format: A string, one of `channels_last` (default) or `channels_first`.
      The ordering of the dimensions in the inputs.
      `channels_last` corresponds to inputs with shape
      `(batch, height, width, channels)` while `channels_first` corresponds to
      inputs with shape `(batch, channels, height, width)`.
class_docstr_tok: ["Pooling","layer","for","arbitrary","pooling","functions",",","for","2D","inputs","(","e.g",".","images",")",".","This","class","only","exists","for","code","reuse",".","It","will","never","be","an","exposed","API",".","Arguments",":","_pool_function",":","The","pooling","function","to","apply",",","e.g",".","`","prot.max_pool2d","`",".","pool_size",":","An","integer","or","tuple\/list","of","2","integers",":","(","pool_height",",","pool_width",")","specifying","the","size","of","the","pooling","window",".","Can","be","a","single","integer","to","specify","the","same","value","for","all","spatial","dimensions",".","strides",":","An","integer","or","tuple\/list","of","2","integers",",","specifying","the","strides","of","the","pooling","operation",".","Can","be","a","single","integer","to","specify","the","same","value","for","all","spatial","dimensions",".","padding",":","A","string",".","The","padding","method",",","either","'valid","'","or","'same","'",".","Case-insensitive",".","data_format",":","A","string",",","one","of","`","channels_last","`","(","default",")","or","`","channels_first","`",".","The","ordering","of","the","dimensions","in","the","inputs",".","`","channels_last","`","corresponds","to","inputs","with","shape","`","(","batch",",","height",",","width",",","channels",")","`","while","`","channels_first","`","corresponds","to","inputs","with","shape","`","(","batch",",","channels",",","height",",","width",")","`","."]
code: def __init__(
      self,
      _pool_function,
      pool_size,
      strides,
      padding="valid",
      data_format=None,
      **kwargs,
  ):
      super(Pooling2D, self).__init__(**kwargs)
  
      if data_format is None:
          data_format = "channels_last"
      if strides is None:
          strides = pool_size
      self._pool_function = _pool_function
      self.pool_size = conv_utils.normalize_tuple(
          pool_size, 2, "pool_size"
      )
      self.strides = conv_utils.normalize_tuple(strides, 2, "strides")
      self.padding = conv_utils.normalize_padding(padding).upper()
      self.data_format = conv_utils.normalize_data_format(data_format)
  
imports: import math
  from abc import abstractmethod
  from tensorflow.python.keras.utils import conv_utils
  import tf_encrypted
  from tf_encrypted.keras.engine import Layer
label_desc: Use image node_id 1 to create a new Pooling2D object from inherited base classes: Layer with example: obj = Pooling2D(_pool_function, pool_size, strides, padding, data_format)