docstr: Args:
      x (Tensor): feature input tensor.
      g (Tensor): global conditioning input tensor.
  
  Returns:
      Tensor: output waveform.
  
  Shapes:
      x: [B, C, T]
      Tensor: [B, 1, T]
docstr_tok: ["Args",":","x","(","Tensor",")",":","feature","input","tensor",".","g","(","Tensor",")",":","global","conditioning","input","tensor",".","Returns",":","Tensor",":","output","waveform",".","Shapes",":","x",":","[","B",",","C",",","T","]","Tensor",":","[","B",",","1",",","T","]"]
code: def forward(self, x, g=None):
      """
      Args:
          x (Tensor): feature input tensor.
          g (Tensor): global conditioning input tensor.
  
      Returns:
          Tensor: output waveform.
  
      Shapes:
          x: [B, C, T]
          Tensor: [B, 1, T]
      """
      o = self.conv_pre(x)
      if hasattr(self, "cond_layer"):
          o = o + self.cond_layer(g)
      for i in range(self.num_upsamples):
          o = F.leaky_relu(o, LRELU_SLOPE)
          o = self.ups[i](o)
  
          if self.cond_in_each_up_layer:
              o = o + self.conds[i](g)
  
          z_sum = None
          for j in range(self.num_kernels):
              if z_sum is None:
                  z_sum = self.resblocks[i * self.num_kernels + j](o)
              else:
                  z_sum += self.resblocks[i * self.num_kernels + j](o)
          o = z_sum / self.num_kernels
      o = F.leaky_relu(o)
      o = self.conv_post(o)
      o = torch.tanh(o)
      return o
  
imports: import torch
  import torchaudio
  from torch import nn
  from torch.nn import Conv1d, ConvTranspose1d
  from torch.nn import functional
  from torch.nn.utils.parametrizations import weight_norm
  from torch.nn.utils.parametrize import remove_parametrizations
  from TTS.utils.io import load_fsspec
label_desc: Use image node_id 2 for calling the HifiganGenerator obj's underlying member method code with example usage: obj.forward(x, g) and returns: o