class_docstr: attention-based label smoothing loss for S2ST.
docstr: Forward.
  Args:
docstr_tok: ["Forward",".","Args",":"]
code: def forward(
      self,
      dense_y: torch.Tensor,
      token_y: torch.Tensor,
  ):
      """Forward.
      Args:
      """
      if self.weight > 0:
          return self.loss(dense_y, token_y)
      else:
          return None
  
file_path: espnet/espnet2/s2st/losses/attention_loss.py
imports: import torch
  import torch.nn.functional
  from typeguard import check_argument_types
  from espnet2.s2st.losses.abs_loss import AbsS2STLoss
  from espnet2.utils.types import str2bool
  from espnet.nets.pytorch_backend.transformer.label_smoothing_loss import LabelSmoothingLoss
label_desc: Use image node_id 2 for calling the S2STAttentionLoss obj's underlying member method code with example usage: obj.forward(dense_y, token_y) and returns: self, None