class_docstr: Generator part of *HiFi GAN* :cite:`NEURIPS2020_c5d73680`.
  Source: https://github.com/jik876/hifi-gan/blob/4769534d45265d52a904b850da5a622601885777/models.py#L75
  
  Note:
      To build the model, please use one of the factory functions: :py:func:`hifigan_vocoder`,
      :py:func:`hifigan_vocoder_v1`, :py:func:`hifigan_vocoder_v2`, :py:func:`hifigan_vocoder_v3`.
  
  Args:
      in_channels (int): Number of channels in the input features.
      upsample_rates (tuple of ``int``): Factors by which each upsampling layer increases the time dimension.
      upsample_initial_channel (int): Number of channels in the input feature tensor.
      upsample_kernel_sizes (tuple of ``int``): Kernel size for each upsampling layer.
      resblock_kernel_sizes (tuple of ``int``): Kernel size for each residual block.
      resblock_dilation_sizes (tuple of tuples of ``int``): Dilation sizes for each 1D convolutional layer in each
          residual block. For resblock type 1 inner tuples should have length 3, because there are 3
          convolutions in each layer. For resblock type 2 they should have length 2.
      resblock_type (int, 1 or 2): Determines whether ``ResBlock1`` or ``ResBlock2`` will be used.
      lrelu_slope (float): Slope of leaky ReLUs in activations.
docstr: Args:
      x (Tensor): Feature input tensor of shape `(batch_size, num_channels, time_length)`.
  
  Returns:
      Tensor of shape `(batch_size, 1, time_length * upsample_rate)`, where `upsample_rate` is the product
      of upsample rates for all layers.
docstr_tok: ["Args",":","x","(","Tensor",")",":","Feature","input","tensor","of","shape","`","(","batch_size",",","num_channels",",","time_length",")","`",".","Returns",":","Tensor","of","shape","`","(","batch_size",",","1",",","time_length","*","upsample_rate",")","`",",","where","`","upsample_rate","`","is","the","product","of","upsample","rates","for","all","layers","."]
code: def forward(self, x: torch.Tensor) -> torch.Tensor:
      """
      Args:
          x (Tensor): Feature input tensor of shape `(batch_size, num_channels, time_length)`.
  
      Returns:
          Tensor of shape `(batch_size, 1, time_length * upsample_rate)`, where `upsample_rate` is the product
          of upsample rates for all layers.
      """
      x = self.conv_pre(x)
      for i, upsampling_layer in enumerate(self.ups):
          x = F.leaky_relu(x, self.lrelu_slope)
          x = upsampling_layer(x)
          xs = torch.zeros_like(x)
          for j in range(self.num_kernels):
              res_block: ResBlockInterface = self.resblocks[
                  i * self.num_kernels + j
              ]
              xs += res_block.forward(x)
          x = xs / self.num_kernels
  
      x = F.leaky_relu(x)
      x = self.conv_post(x)
      x = torch.tanh(x)
  
      return x
  
imports: from typing import Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.nn import Conv1d, ConvTranspose1d
label_desc: Use image node_id 2 for calling the HiFiGANVocoder obj's underlying member method code with example usage: obj.forward(x) and returns: x