class_docstr: This class implements the adaptive average pooling.
  
  Arguments
  ---------
  delations : output_size
      The size of the output.
  
  Example
  -------
  >>> pool = AdaptivePool(1)
  >>> inp = torch.randn([8, 120, 40])
  >>> output = pool(inp)
  >>> output.shape
  torch.Size([8, 1, 40])
code: def __init__(self, output_size):
      super().__init__()
  
      condition = (
          isinstance(output_size, int)
          or isinstance(output_size, tuple)
          or isinstance(output_size, list)
      )
      assert condition, "output size must be int, list or tuple"
  
      if isinstance(output_size, tuple) or isinstance(
          output_size, list
      ):
          assert (
              len(output_size) == 2
          ), "len of output size must not be greater than 2"
  
      if isinstance(output_size, int):
          self.pool = nn.AdaptiveAvgPool1d(output_size)
      else:
          self.pool = nn.AdaptiveAvgPool2d(output_size)
  
imports: import torch
  import logging
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new AdaptivePool object from inherited base classes: nn with example: obj = AdaptivePool(output_size)