class_docstr: This function implements 2d pooling of the input tensor.
  
  Arguments
  ---------
  pool_type : str
      It is the type of pooling function to use ('avg','max').
  pool_axis : tuple
      It is a list containing the axis that will be considered
      during pooling.
  kernel_size : int
      It is the kernel size that defines the pooling dimension.
      For instance, kernel size=3,3 performs a 2D Pooling with a 3x3 kernel.
  stride : int
      It is the stride size.
  padding : int
      It is the number of padding elements to apply.
  dilation : int
      Controls the dilation factor of pooling.
  ceil_mode : bool
      When True, will use ceil instead of floor to compute the output shape.
  
  Example
  -------
  >>> pool = Pooling2d('max',(5,3))
  >>> inputs = torch.rand(10, 15, 12)
  >>> output=pool(inputs)
  >>> output.shape
  torch.Size([10, 3, 4])
code: def __init__(
      self,
      pool_type,
      kernel_size,
      pool_axis=(1, 2),
      ceil_mode=False,
      padding=0,
      dilation=1,
      stride=None,
  ):
      super().__init__()
      self.pool_type = pool_type
      self.kernel_size = kernel_size
      self.pool_axis = pool_axis
      self.ceil_mode = ceil_mode
      self.padding = padding
      self.dilation = dilation
  
      if stride is None:
          self.stride = kernel_size
      else:
          self.stride = stride
  
      if self.pool_type == "avg":
          self.pool_layer = torch.nn.AvgPool2d(
              self.kernel_size,
              stride=self.stride,
              padding=self.padding,
              ceil_mode=self.ceil_mode,
          )
      else:
          self.pool_layer = torch.nn.MaxPool2d(
              self.kernel_size,
              stride=self.stride,
              padding=self.padding,
              ceil_mode=self.ceil_mode,
          )
  
imports: import torch
  import logging
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new Pooling2d object from inherited base classes: nn with example: obj = Pooling2d(pool_type, kernel_size, pool_axis, ceil_mode, padding, dilation, stride)