class_docstr: Generator adversarial loss module.
class_docstr_tok: ["Generator","adversarial","loss","module","."]
docstr: Calcualate generator adversarial loss.
  
  Args:
      outputs (Union[List[List[Tensor]], List[Tensor], Tensor]): Discriminator
          outputs, list of discriminator outputs, or list of list of discriminator
          outputs..
  
  Returns:
      Tensor: Generator adversarial loss value.
docstr_tok: ["Calcualate","generator","adversarial","loss",".","Args",":","outputs","(","Union","[","List","[","List","[","Tensor","]","]",",","List","[","Tensor","]",",","Tensor","]",")",":","Discriminator","outputs",",","list","of","discriminator","outputs",",","or","list","of","list","of","discriminator","outputs","..","Returns",":","Tensor",":","Generator","adversarial","loss","value","."]
code: def forward(
      self,
      outputs: Union[
          List[List[torch.Tensor]], List[torch.Tensor], torch.Tensor
      ],
  ) -> torch.Tensor:
      """Calcualate generator adversarial loss.
  
      Args:
          outputs (Union[List[List[Tensor]], List[Tensor], Tensor]): Discriminator
              outputs, list of discriminator outputs, or list of list of discriminator
              outputs..
  
      Returns:
          Tensor: Generator adversarial loss value.
  
      """
      if isinstance(outputs, (tuple, list)):
          adv_loss = 0.0
          for i, outputs_ in enumerate(outputs):
              if isinstance(outputs_, (tuple, list)):
                  # NOTE(kan-bayashi): case including feature maps
                  outputs_ = outputs_[-1]
              adv_loss += self.criterion(outputs_)
          if self.average_by_discriminators:
              adv_loss /= i + 1
      else:
          adv_loss = self.criterion(outputs)
  
      return adv_loss
  
imports: from typing import List, Optional, Tuple, Union
  import torch
  import torch.nn.functional
  from espnet2.tts.feats_extract.log_mel_fbank import LogMelFbank
label_desc: Use image node_id 2 for calling the GeneratorAdversarialLoss obj's underlying member method code with example usage: obj.forward(outputs) and returns: adv_loss