class_docstr: auxiliary pseudo label loss for UASR.
docstr: Forward.
  
  Args:
code: def forward(
      self,
      inter_x: torch.Tensor,
      pseudo_labels: torch.Tensor,
      is_discriminative_step: str2bool,
  ):
      """Forward.
  
      Args:
      """
      if (
          self.weight > 0
          and not is_discriminative_step
          and pseudo_labels is not None
      ):
          inter_x = self.decoder(inter_x)
  
          if self.downsample_rate > 1:
              pseudo_labels = pseudo_labels[:, :: self.downsample_rate]
          valid_time_length = min(
              pseudo_labels.shape[1], inter_x.shape[1]
          )
          pseudo_label_loss = F.cross_entropy(
              inter_x[:, :valid_time_length].transpose(1, 2),
              pseudo_labels[:, :valid_time_length],
              ignore_index=self.ignore_index,
              reduction=self.reduction,
          )
          pseudo_label_loss = (
              pseudo_label_loss.mean() * pseudo_label_loss.shape[0]
          )
  
          return pseudo_label_loss
      else:
          return 0
  
file_path: espnet/espnet2/uasr/loss/pseudo_label_loss.py
imports: import torch
  import torch.nn.functional
  from typeguard import check_argument_types
  from espnet2.uasr.loss.abs_loss import AbsUASRLoss
  from espnet2.utils.types import str2bool
label_desc: Use image node_id 2 for calling the UASRPseudoLabelLoss obj's underlying member method code with example usage: obj.forward(inter_x, pseudo_labels, is_discriminative_step) and returns: pseudo_label_loss, int