class_docstr: E2E module.
  
  :param List idims: List of dimensions of inputs
  :param int odim: dimension of outputs
  :param Namespace args: argument Namespace containing options
docstr: Initialize this class with python-level args.
  
  Args:
      idims (list): list of the number of an input feature dim.
      odim (int): The number of output vocab.
      args (Namespace): arguments
code: def __init__(self, idims, odim, args):
      """Initialize this class with python-level args.
  
      Args:
          idims (list): list of the number of an input feature dim.
          odim (int): The number of output vocab.
          args (Namespace): arguments
  
      """
      super(E2E, self).__init__()
      torch.nn.Module.__init__(self)
      self.mtlalpha = args.mtlalpha
      assert (
          0.0 <= self.mtlalpha <= 1.0
      ), "mtlalpha should be [0.0, 1.0]"
      self.verbose = args.verbose
      # NOTE: for self.build method
      args.char_list = getattr(args, "char_list", None)
      self.char_list = args.char_list
      self.outdir = args.outdir
      self.space = args.sym_space
      self.blank = args.sym_blank
      self.reporter = Reporter()
      self.num_encs = args.num_encs
      self.share_ctc = args.share_ctc
  
      # 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_list = get_subsample(
          args, mode="asr", arch="rnn_mulenc"
      )
  
      # label smoothing info
      if args.lsm_type and os.path.isfile(args.train_json):
          logging.info("Use label smoothing with " + args.lsm_type)
          labeldist = label_smoothing_dist(
              odim, args.lsm_type, transcript=args.train_json
          )
      else:
          labeldist = None
  
      # speech translation related
      self.replace_sos = getattr(
          args, "replace_sos", False
      )  # use getattr to keep compatibility
  
      self.frontend = None
  
      # encoder
      self.enc = encoder_for(args, idims, self.subsample_list)
      # ctc
      self.ctc = ctc_for(args, odim)
      # attention
      self.att = att_for(args)
      # hierarchical attention network
      han = att_for(args, han_mode=True)
      self.att.append(han)
      # decoder
      self.dec = decoder_for(
          args, odim, self.sos, self.eos, self.att, labeldist
      )
  
      if args.mtlalpha > 0 and self.num_encs > 1:
          # weights-ctc,
          # e.g. ctc_loss = w_1*ctc_1_loss + w_2 * ctc_2_loss + w_N * ctc_N_loss
          self.weights_ctc_train = args.weights_ctc_train / np.sum(
              args.weights_ctc_train
          )  # normalize
          self.weights_ctc_dec = args.weights_ctc_dec / np.sum(
              args.weights_ctc_dec
          )  # normalize
          logging.info(
              "ctc weights (training during training): "
              + " ".join([str(x) for x in self.weights_ctc_train])
          )
          logging.info(
              "ctc weights (decoding during training): "
              + " ".join([str(x) for x in self.weights_ctc_dec])
          )
      else:
          self.weights_ctc_dec = [1.0]
          self.weights_ctc_train = [1.0]
  
      # weight initialization
      self.init_like_chainer()
  
      # options for beam search
      if args.report_cer or args.report_wer:
          recog_args = {
              "beam_size": args.beam_size,
              "penalty": args.penalty,
              "ctc_weight": args.ctc_weight,
              "maxlenratio": args.maxlenratio,
              "minlenratio": args.minlenratio,
              "lm_weight": args.lm_weight,
              "rnnlm": args.rnnlm,
              "nbest": args.nbest,
              "space": args.sym_space,
              "blank": args.sym_blank,
              "tgt_lang": False,
              "ctc_weights_dec": self.weights_ctc_dec,
          }
  
          self.recog_args = argparse.Namespace(**recog_args)
          self.report_cer = args.report_cer
          self.report_wer = args.report_wer
      else:
          self.report_cer = False
          self.report_wer = False
      self.rnnlm = None
  
      self.logzero = -10000000000.0
      self.loss = None
      self.acc = None
  
imports: import argparse
  import logging
  import math
  import os
  from itertools import groupby
  import chainer
  import numpy
  import torch
  from chainer import reporter
  from espnet.nets.asr_interface import ASRInterface
  from espnet.nets.e2e_asr_common import label_smoothing_dist
  from espnet.nets.pytorch_backend.ctc import ctc_for
  from espnet.nets.pytorch_backend.nets_utils import get_subsample, pad_list, to_device, to_torch_tensor
  from espnet.nets.pytorch_backend.rnn.attentions import att_for
  from espnet.nets.pytorch_backend.rnn.decoders import decoder_for
  from espnet.nets.pytorch_backend.rnn.encoders import Encoder, encoder_for
  from espnet.nets.scorers.ctc import CTCPrefixScorer
  from espnet.utils.cli_utils import strtobool
label_desc: Use image node_id 7 to create a new E2E object from inherited base classes: ASRInterface, torch.nn with example: obj = E2E(idims, odim, args)