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: Construct an E2E object.
  
  :param int idim: dimension of inputs
  :param int odim: dimension of outputs
  :param Namespace args: argument Namespace containing options
docstr_tok: ["Construct","an","E2E","object",".",":","param","int","idim",":","dimension","of","inputs",":","param","int","odim",":","dimension","of","outputs",":","param","Namespace","args",":","argument","Namespace","containing","options"]
code: def __init__(self, idim, odim, args, flag_return=True):
      """Construct an E2E object.
  
      :param int idim: dimension of inputs
      :param int odim: dimension of outputs
      :param Namespace args: argument Namespace containing options
      """
      chainer.Chain.__init__(self)
      self.mtlalpha = args.mtlalpha
      assert 0 <= self.mtlalpha <= 1, "mtlalpha must be [0,1]"
      self.etype = args.etype
      self.verbose = args.verbose
      self.char_list = args.char_list
      self.outdir = args.outdir
  
      # below means the last number becomes eos/sos ID
      # note that sos/eos IDs are identical
      self.sos = odim - 1
      self.eos = odim - 1
  
      # subsample info
      self.subsample = get_subsample(args, mode="asr", arch="rnn")
  
      # label smoothing info
      if args.lsm_type:
          logging.info("Use label smoothing with " + args.lsm_type)
          labeldist = label_smoothing_dist(
              odim, args.lsm_type, transcript=args.train_json
          )
      else:
          labeldist = None
  
      with self.init_scope():
          # encoder
          self.enc = encoder_for(args, idim, self.subsample)
          # ctc
          self.ctc = ctc_for(args, odim)
          # attention
          self.att = att_for(args)
          # decoder
          self.dec = decoder_for(
              args, odim, self.sos, self.eos, self.att, labeldist
          )
  
      self.acc = None
      self.loss = None
      self.flag_return = flag_return
  
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 3 to create a new E2E object from inherited base classes: ChainerASRInterface with example: obj = E2E(idim, odim, args, flag_return)