class_docstr: HiFiGAN generator module.
docstr: Calculate forward propagation.
  
  Args:
      c (Tensor): Input tensor (B, in_channels, T).
      g (Optional[Tensor]): Global conditioning tensor (B, global_channels, 1).
  
  Returns:
      Tensor: Output tensor (B, out_channels, T).
docstr_tok: ["Calculate","forward","propagation",".","Args",":","c","(","Tensor",")",":","Input","tensor","(","B",",","in_channels",",","T",")",".","g","(","Optional","[","Tensor","]",")",":","Global","conditioning","tensor","(","B",",","global_channels",",","1",")",".","Returns",":","Tensor",":","Output","tensor","(","B",",","out_channels",",","T",")","."]
code: def forward(
      self, c: torch.Tensor, g: Optional[torch.Tensor] = None
  ) -> torch.Tensor:
      """Calculate forward propagation.
  
      Args:
          c (Tensor): Input tensor (B, in_channels, T).
          g (Optional[Tensor]): Global conditioning tensor (B, global_channels, 1).
  
      Returns:
          Tensor: Output tensor (B, out_channels, T).
  
      """
      c = self.input_conv(c)
      if g is not None:
          c = c + self.global_conv(g)
      for i in range(self.num_upsamples):
          c = self.upsamples[i](c)
          cs = 0.0  # initialize
          for j in range(self.num_blocks):
              cs += self.blocks[i * self.num_blocks + j](c)
          c = cs / self.num_blocks
      c = self.output_conv(c)
  
      return c
  
imports: import copy
  import logging
  from typing import Any, Dict, List, Optional
  import numpy
  import torch
  import torch.nn.functional
  from espnet2.gan_tts.hifigan.residual_block import ResidualBlock
label_desc: Use image node_id 2 for calling the HiFiGANGenerator obj's underlying member method code with example usage: obj.forward(c, g) and returns: c