class_docstr: E2E module.
  
  :param int idim: dimension of inputs
  :param int odim: dimension of outputs
  :param Namespace args: argument Namespace containing options
docstr: E2E forward.
  
  :param torch.Tensor xs_pad: batch of padded source sequences (B, Tmax, idim)
  :param torch.Tensor ilens: batch of lengths of source sequences (B)
  :param torch.Tensor ys_pad: batch of padded target sequences (B, Lmax)
  :param torch.Tensor ys_pad_src: batch of padded target sequences (B, Lmax)
  :return: ctc loss value
  :rtype: torch.Tensor
  :return: attention loss value
  :rtype: torch.Tensor
  :return: accuracy in attention decoder
  :rtype: float
code: def forward(self, xs_pad, ilens, ys_pad, ys_pad_src):
      """E2E forward.
  
      :param torch.Tensor xs_pad: batch of padded source sequences (B, Tmax, idim)
      :param torch.Tensor ilens: batch of lengths of source sequences (B)
      :param torch.Tensor ys_pad: batch of padded target sequences (B, Lmax)
      :param torch.Tensor ys_pad_src: batch of padded target sequences (B, Lmax)
      :return: ctc loss value
      :rtype: torch.Tensor
      :return: attention loss value
      :rtype: torch.Tensor
      :return: accuracy in attention decoder
      :rtype: float
      """
      # 0. Extract target language ID
      tgt_lang_ids = None
      if self.multilingual:
          tgt_lang_ids = ys_pad[:, 0:1]
          ys_pad = ys_pad[
              :, 1:
          ]  # remove target language ID in the beginning
  
      # 1. forward encoder
      xs_pad = xs_pad[:, : max(ilens)]  # for data parallel
      src_mask = (
          make_non_pad_mask(ilens.tolist())
          .to(xs_pad.device)
          .unsqueeze(-2)
      )
      hs_pad, hs_mask = self.encoder(xs_pad, src_mask)
  
      # 2. forward decoder
      ys_in_pad, ys_out_pad = add_sos_eos(
          ys_pad, self.sos, self.eos, self.ignore_id
      )
      # replace <sos> with target language ID
      if self.replace_sos:
          ys_in_pad = torch.cat([tgt_lang_ids, ys_in_pad[:, 1:]], dim=1)
      ys_mask = target_mask(ys_in_pad, self.ignore_id)
      pred_pad, pred_mask = self.decoder(
          ys_in_pad, ys_mask, hs_pad, hs_mask
      )
  
      # 3. compute ST loss
      loss_att = self.criterion(pred_pad, ys_out_pad)
  
      self.acc = th_accuracy(
          pred_pad.view(-1, self.odim),
          ys_out_pad,
          ignore_label=self.ignore_id,
      )
  
      # 4. compute corpus-level bleu in a mini-batch
      if self.training:
          self.bleu = None
      else:
          ys_hat = pred_pad.argmax(dim=-1)
          self.bleu = self.error_calculator(ys_hat.cpu(), ys_pad.cpu())
  
      # 5. compute auxiliary ASR loss
      (
          loss_asr_att,
          acc_asr,
          loss_asr_ctc,
          cer_ctc,
          cer,
          wer,
      ) = self.forward_asr(hs_pad, hs_mask, ys_pad_src)
  
      # 6. compute auxiliary MT loss
      loss_mt, acc_mt = 0.0, None
      if self.mt_weight > 0:
          loss_mt, acc_mt = self.forward_mt(
              ys_pad_src, ys_in_pad, ys_out_pad, ys_mask
          )
  
      asr_ctc_weight = self.mtlalpha
      self.loss = (
          (1 - self.asr_weight - self.mt_weight) * loss_att
          + self.asr_weight
          * (
              asr_ctc_weight * loss_asr_ctc
              + (1 - asr_ctc_weight) * loss_asr_att
          )
          + self.mt_weight * loss_mt
      )
      loss_asr_data = float(
          asr_ctc_weight * loss_asr_ctc
          + (1 - asr_ctc_weight) * loss_asr_att
      )
      loss_mt_data = None if self.mt_weight == 0 else float(loss_mt)
      loss_st_data = float(loss_att)
  
      loss_data = float(self.loss)
      if loss_data < CTC_LOSS_THRESHOLD and not math.isnan(loss_data):
          self.reporter.report(
              loss_asr_data,
              loss_mt_data,
              loss_st_data,
              acc_asr,
              acc_mt,
              self.acc,
              cer_ctc,
              cer,
              wer,
              self.bleu,
              loss_data,
          )
      else:
          logging.warning("loss (=%f) is not correct", loss_data)
      return self.loss
  
imports: import logging
  import math
  from argparse import Namespace
  import numpy
  import torch
  from espnet.nets.e2e_asr_common import ErrorCalculator
  from espnet.nets.e2e_asr_common import end_detect
  from espnet.nets.e2e_mt_common import ErrorCalculator
  from espnet.nets.pytorch_backend.ctc import CTC
  from espnet.nets.pytorch_backend.e2e_asr import CTC_LOSS_THRESHOLD
  from espnet.nets.pytorch_backend.e2e_st import Reporter
  from espnet.nets.pytorch_backend.nets_utils import get_subsample, make_non_pad_mask, pad_list, th_accuracy
  from espnet.nets.pytorch_backend.transformer.add_sos_eos import add_sos_eos
  from espnet.nets.pytorch_backend.transformer.argument import add_arguments_transformer_common
  from espnet.nets.pytorch_backend.transformer.attention import MultiHeadedAttention
  from espnet.nets.pytorch_backend.transformer.decoder import Decoder
  from espnet.nets.pytorch_backend.transformer.encoder import Encoder
  from espnet.nets.pytorch_backend.transformer.initializer import initialize
  from espnet.nets.pytorch_backend.transformer.label_smoothing_loss import LabelSmoothingLoss
  from espnet.nets.pytorch_backend.transformer.mask import subsequent_mask, target_mask
  from espnet.nets.pytorch_backend.transformer.plot import PlotAttentionReport
  from espnet.nets.st_interface import STInterface
  from espnet.utils.fill_missing_args import fill_missing_args
label_desc: Use image node_id 6 for calling the E2E obj's underlying member method code with example usage: obj.forward(xs_pad, ilens, ys_pad, ys_pad_src) and returns: self