class_docstr: E2E module for chainer backend.
  
  Args:
      idim (int): Dimension of the inputs.
      odim (int): Dimension of the outputs.
      args (parser.args): Training config.
      flag_return (bool): If True, train() would return
          additional metrics in addition to the training
          loss.
docstr: E2E forward propagation.
  
  Args:
      xs (chainer.Variable): Batch of padded character ids. (B, Tmax)
      ilens (chainer.Variable): Batch of length of each input batch. (B,)
      ys (chainer.Variable): Batch of padded target features. (B, Lmax, odim)
  
  Returns:
      float: Loss that calculated by attention and ctc loss.
      float (optional): Ctc loss.
      float (optional): Attention loss.
      float (optional): Accuracy.
docstr_tok: ["E2E","forward","propagation",".","Args",":","xs","(","chainer.Variable",")",":","Batch","of","padded","character","ids",".","(","B",",","Tmax",")","ilens","(","chainer.Variable",")",":","Batch","of","length","of","each","input","batch",".","(","B",",",")","ys","(","chainer.Variable",")",":","Batch","of","padded","target","features",".","(","B",",","Lmax",",","odim",")","Returns",":","float",":","Loss","that","calculated","by","attention","and","ctc","loss",".","float","(","optional",")",":","Ctc","loss",".","float","(","optional",")",":","Attention","loss",".","float","(","optional",")",":","Accuracy","."]
code: def forward(self, xs, ilens, ys):
      """E2E forward propagation.
  
      Args:
          xs (chainer.Variable): Batch of padded character ids. (B, Tmax)
          ilens (chainer.Variable): Batch of length of each input batch. (B,)
          ys (chainer.Variable): Batch of padded target features. (B, Lmax, odim)
  
      Returns:
          float: Loss that calculated by attention and ctc loss.
          float (optional): Ctc loss.
          float (optional): Attention loss.
          float (optional): Accuracy.
  
      """
      # 1. encoder
      hs, ilens = self.enc(xs, ilens)
  
      # 3. CTC loss
      if self.mtlalpha == 0:
          loss_ctc = None
      else:
          loss_ctc = self.ctc(hs, ys)
  
      # 4. attention loss
      if self.mtlalpha == 1:
          loss_att = None
          acc = None
      else:
          loss_att, acc = self.dec(hs, ys)
  
      self.acc = acc
      alpha = self.mtlalpha
      if alpha == 0:
          self.loss = loss_att
      elif alpha == 1:
          self.loss = loss_ctc
      else:
          self.loss = alpha * loss_ctc + (1 - alpha) * loss_att
  
      if self.loss.data < CTC_LOSS_THRESHOLD and not math.isnan(
          self.loss.data
      ):
          reporter.report({"loss_ctc": loss_ctc}, self)
          reporter.report({"loss_att": loss_att}, self)
          reporter.report({"acc": acc}, self)
  
          logging.info("mtl loss:" + str(self.loss.data))
          reporter.report({"loss": self.loss}, self)
      else:
          logging.warning("loss (=%f) is not correct", self.loss.data)
      if self.flag_return:
          return self.loss, loss_ctc, loss_att, acc
      else:
          return self.loss
  
imports: import logging
  import math
  import chainer
  import numpy
  from chainer import reporter
  from espnet.nets.chainer_backend.asr_interface import ChainerASRInterface
  from espnet.nets.chainer_backend.ctc import ctc_for
  from espnet.nets.chainer_backend.rnn.attentions import att_for
  from espnet.nets.chainer_backend.rnn.decoders import decoder_for
  from espnet.nets.chainer_backend.rnn.encoders import encoder_for
  from espnet.nets.e2e_asr_common import label_smoothing_dist
  from espnet.nets.pytorch_backend.e2e_asr import E2E
  from espnet.nets.pytorch_backend.nets_utils import get_subsample
label_desc: Use image node_id 4 for calling the E2E obj's underlying member method code with example usage: obj.forward(xs, ilens, ys) and returns: self,  loss_ctc,  loss_att,  acc, self