class_docstr: HiFiGAN Periodic Discriminator
  
  Takes every Pth value from the input waveform and applied a stack of convoluations.
  
  Note:
      if `period` is 2
      `waveform = [1, 2, 3, 4, 5, 6 ...] --> [1, 3, 5 ... ] --> convs -> score, feat`
  
  Args:
      x (Tensor): input waveform.
  
  Returns:
      [Tensor]: discriminator scores per sample in the batch.
      [List[Tensor]]: list of features from each convolutional layer.
  
  Shapes:
      x: [B, 1, T]
docstr: Args:
      x (Tensor): input waveform.
  
  Returns:
      [Tensor]: discriminator scores per sample in the batch.
      [List[Tensor]]: list of features from each convolutional layer.
  
  Shapes:
      x: [B, 1, T]
docstr_tok: ["Args",":","x","(","Tensor",")",":","input","waveform",".","Returns",":","[","Tensor","]",":","discriminator","scores","per","sample","in","the","batch",".","[","List","[","Tensor","]","]",":","list","of","features","from","each","convolutional","layer",".","Shapes",":","x",":","[","B",",","1",",","T","]"]
code: def forward(self, x):
      """
      Args:
          x (Tensor): input waveform.
  
      Returns:
          [Tensor]: discriminator scores per sample in the batch.
          [List[Tensor]]: list of features from each convolutional layer.
  
      Shapes:
          x: [B, 1, T]
      """
      feat = []
  
      # 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 l in self.convs:
          x = l(x)
          x = F.leaky_relu(x, LRELU_SLOPE)
          feat.append(x)
      x = self.conv_post(x)
      feat.append(x)
      x = torch.flatten(x, 1, -1)
  
      return x, feat
  
imports: import torch
  from torch import nn
  from torch.nn import functional
label_desc: Use image node_id 2 for calling the DiscriminatorP obj's underlying member method code with example usage: obj.forward(x) and returns: x,  feat