class_docstr: This function implements 1d pooling of the input tensor.
  
  Arguments
  ---------
  pool_type : str
      It is the type of pooling function to use ('avg','max').
  kernel_size : int
      It is the kernel size that defines the pooling dimension.
      For instance, kernel size=3 applies a 1D Pooling with a size=3.
  input_dims : int
      The count of dimensions expected in the input.
  pool_axis : int
      The axis where the pooling is applied.
  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 = Pooling1d('max',3)
  >>> inputs = torch.rand(10, 12, 40)
  >>> output=pool(inputs)
  >>> output.shape
  torch.Size([10, 4, 40])
docstr: Performs 1d pooling to the input tensor.
  
  Arguments
  ---------
  x : torch.Tensor
      It represents a tensor for a mini-batch.
docstr_tok: ["Performs","1d","pooling","to","the","input","tensor",".","Arguments","--","--","--","--","-","x",":","torch.Tensor","It","represents","a","tensor","for","a","mini-batch","."]
code: def forward(self, x):
      """Performs 1d pooling to the input tensor.
  
      Arguments
      ---------
      x : torch.Tensor
          It represents a tensor for a mini-batch.
      """
      # Put the pooling axes as the last dimension for torch.nn.pool
      x = x.transpose(-1, self.pool_axis)
  
      # Apply pooling
      x = self.pool_layer(x)
  
      # Recover input shape
      x = x.transpose(-1, self.pool_axis)
  
      return x
  
imports: import torch
  import logging
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 2 for calling the Pooling1d obj's underlying member method code with example usage: obj.forward(x) and returns: x