class_docstr: A wrapper module that applies the necessary padding for
  the downsampling factor
  
  Arguments
  ---------
  factor: int
      the downsampling / divisibility factor
  len_dim: int
      the index of the dimension in which the length will vary
  dims: list
      the list of dimensions to be included in padding
  
  Example
  -------
  >>> padding = DownsamplingPadding(factor=4, dims=[1, 2], len_dim=1)
  >>> x = torch.randn(4, 7, 14)
  >>> length = torch.tensor([1., 0.8, 1., 0.7])
  >>> x, length_new = padding(x, length)
  >>> x.shape
  torch.Size([4, 8, 16])
  >>> length_new
  tensor([0.8750, 0.7000, 0.8750, 0.6125])
class_docstr_tok: ["A","wrapper","module","that","applies","the","necessary","padding","for","the","downsampling","factor","Arguments","--","--","--","--","-","factor",":","int","the","downsampling","\/","divisibility","factor","len_dim",":","int","the","index","of","the","dimension","in","which","the","length","will","vary","dims",":","list","the","list","of","dimensions","to","be","included","in","padding","Example","--","--","--","-",">",">",">","padding","=","DownsamplingPadding","(","factor=4",",","dims=","[","1",",","2","]",",","len_dim=1",")",">",">",">","x","=","torch.randn","(","4",",","7",",","14",")",">",">",">","length","=","torch.tensor","(","[","1.",",","0.8",",","1.",",","0.7","]",")",">",">",">","x",",","length_new","=","padding","(","x",",","length",")",">",">",">","x.shape","torch.Size","(","[","4",",","8",",","16","]",")",">",">",">","length_new","tensor","(","[","0.8750",",","0.7000",",","0.8750",",","0.6125","]",")"]
code: def __init__(self, factor, len_dim=2, dims=None):
      super().__init__()
      self.factor = factor
      self.len_dim = len_dim
      if dims is None:
          dims = DEFAULT_PADDING_DIMS
      self.dims = dims
  
imports: from abc import abstractmethod
  from speechbrain.utils.data_utils import pad_divisible
  from .autoencoders import NormalizingAutoencoder
  import math
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new DownsamplingPadding object from inherited base classes: nn with example: obj = DownsamplingPadding(factor, len_dim, dims)