class_docstr: Period sub-discriminator.
  
  Args:
      period (int): Period between samples of audio.
      in_channels (int): Number of input channels.
      out_channels (int): Number of output channels.
      n_layers (int): Number of convolutional layers.
      kernel_sizes (list of int): Kernel sizes for convolutions.
      stride (int): Stride for convolutions.
      filters (int): Initial number of filters in convolutions.
      filters_scale (int): Multiplier of number of filters as we increase depth.
      max_filters (int): Maximum number of filters.
      norm (str): Normalization method.
      activation (str): Activation function.
      activation_params (dict): Parameters to provide to the activation function.
class_docstr_tok: ["Period","sub-discriminator",".","Args",":","period","(","int",")",":","Period","between","samples","of","audio",".","in_channels","(","int",")",":","Number","of","input","channels",".","out_channels","(","int",")",":","Number","of","output","channels",".","n_layers","(","int",")",":","Number","of","convolutional","layers",".","kernel_sizes","(","list","of","int",")",":","Kernel","sizes","for","convolutions",".","stride","(","int",")",":","Stride","for","convolutions",".","filters","(","int",")",":","Initial","number","of","filters","in","convolutions",".","filters_scale","(","int",")",":","Multiplier","of","number","of","filters","as","we","increase","depth",".","max_filters","(","int",")",":","Maximum","number","of","filters",".","norm","(","str",")",":","Normalization","method",".","activation","(","str",")",":","Activation","function",".","activation_params","(","dict",")",":","Parameters","to","provide","to","the","activation","function","."]
code: def forward(self, x: torch.Tensor):
      fmap = []
      # 1d to 2d
      b, c, t = x.shape
      if t % self.period != 0:  # pad first
          n_pad = self.period - (t % self.period)
          x = F.pad(x, (0, n_pad), "reflect")
          t = t + n_pad
      x = x.view(b, c, t // self.period, self.period)
  
      for conv in self.convs:
          x = conv(x)
          x = self.activation(x)
          fmap.append(x)
      x = self.conv_post(x)
      fmap.append(x)
      # x = torch.flatten(x, 1, -1)
  
      return x, fmap
  
file_path: audiocraft/audiocraft/adversarial/discriminators/mpd.py
imports: import typing
  import torch
  import torch.nn
  import torch.nn.functional
  from ...modules import NormConv2d
  from .base import MultiDiscriminator, MultiDiscriminatorOutputType
label_desc: Use image node_id 2 for calling the PeriodDiscriminator obj's underlying member method code with example usage: obj.forward(x) and returns: x,  fmap