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])
docstr: Performs adpative pooling to the input tensor.
  
  Arguments
  ---------
  x : torch.Tensor
      It represents a tensor for a mini-batch.
docstr_tok: ["Performs","adpative","pooling","to","the","input","tensor",".","Arguments","--","--","--","--","-","x",":","torch.Tensor","It","represents","a","tensor","for","a","mini-batch","."]
code: def forward(self, x):
      """Performs adpative pooling to the input tensor.
  
      Arguments
      ---------
      x : torch.Tensor
          It represents a tensor for a mini-batch.
      """
      if x.ndim == 3:
          return self.pool(x.permute(0, 2, 1)).permute(0, 2, 1)
  
      if x.ndim == 4:
          return self.pool(x.permute(0, 3, 1, 2)).permute(0, 2, 3, 1)
  
imports: import torch
  import logging
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 2 for calling the AdaptivePool obj's underlying member method code with example usage: obj.forward(x) and returns: self, self