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.
code: def __init__(
      self,
      in_channels: int,
      upsample_rates: Tuple[int, ...],
      upsample_initial_channel: int,
      upsample_kernel_sizes: Tuple[int, ...],
      resblock_kernel_sizes: Tuple[int, ...],
      resblock_dilation_sizes: Tuple[Tuple[int, ...], ...],
      resblock_type: int,
      lrelu_slope: float,
  ):
      super(HiFiGANVocoder, self).__init__()
      self.num_kernels = len(resblock_kernel_sizes)
      self.num_upsamples = len(upsample_rates)
      self.conv_pre = Conv1d(
          in_channels, upsample_initial_channel, 7, 1, padding=3
      )
      resblock = ResBlock1 if resblock_type == 1 else ResBlock2
  
      self.ups = nn.ModuleList()
      for i, (u, k) in enumerate(
          zip(upsample_rates, upsample_kernel_sizes)
      ):
          self.ups.append(
              ConvTranspose1d(
                  upsample_initial_channel // (2**i),
                  upsample_initial_channel // (2 ** (i + 1)),
                  k,
                  u,
                  padding=(k - u) // 2,
              )
          )
  
      self.resblocks = nn.ModuleList()
      for i in range(len(self.ups)):
          ch = upsample_initial_channel // (2 ** (i + 1))
          for k, d in zip(
              resblock_kernel_sizes, resblock_dilation_sizes
          ):
              self.resblocks.append(resblock(ch, k, d, lrelu_slope))
  
      self.conv_post = Conv1d(ch, 1, 7, 1, padding=3)
      self.lrelu_slope = lrelu_slope
  
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 1 to create a new HiFiGANVocoder object from inherited base classes: torch.nn with example: obj = HiFiGANVocoder(in_channels, upsample_rates, upsample_initial_channel, upsample_kernel_sizes, resblock_kernel_sizes, resblock_dilation_sizes, resblock_type, lrelu_slope)