class_docstr: Encoder-Decoder model
class_docstr_tok: ["Encoder-Decoder","model"]
code: def __init__(
      self,
      vocab_size: int,
      token_list: Union[Tuple[str, ...], List[str]],
      frontend: Optional[AbsFrontend],
      specaug: Optional[AbsSpecAug],
      preencoder: Optional[AbsPreEncoder],
      encoder: AbsEncoder,
      postencoder: Optional[AbsPostEncoder],
      decoder: AbsDecoder,
      ctc: Optional[CTC],
      ctc_weight: float = 0.5,
      interctc_weight: float = 0.0,
      src_vocab_size: int = 0,
      src_token_list: Union[Tuple[str, ...], List[str]] = [],
      ignore_id: int = -1,
      lsm_weight: float = 0.0,
      length_normalized_loss: bool = False,
      report_bleu: bool = True,
      sym_space: str = "<space>",
      sym_blank: str = "<blank>",
      extract_feats_in_collect_stats: bool = True,
      share_decoder_input_output_embed: bool = False,
      share_encoder_decoder_input_embed: bool = False,
  ):
      assert check_argument_types()
      assert 0.0 <= ctc_weight <= 1.0, ctc_weight
  
      super().__init__(
          vocab_size=vocab_size,
          token_list=token_list,
          frontend=frontend,
          preencoder=preencoder,
          encoder=encoder,
          postencoder=postencoder,
          decoder=decoder,
          src_vocab_size=src_vocab_size,
          src_token_list=src_token_list,
          ignore_id=ignore_id,
          lsm_weight=lsm_weight,
          length_normalized_loss=length_normalized_loss,
          report_bleu=report_bleu,
          sym_space=sym_space,
          sym_blank=sym_blank,
          extract_feats_in_collect_stats=extract_feats_in_collect_stats,
          share_decoder_input_output_embed=share_decoder_input_output_embed,
          share_encoder_decoder_input_embed=share_encoder_decoder_input_embed,
      )
  
      self.specaug = specaug
      # note that eos is the same as sos (equivalent ID)
      self.blank_id = 0
      self.ctc_weight = ctc_weight
      self.interctc_weight = interctc_weight
  
      if ctc_weight == 0.0:
          self.ctc = None
      else:
          self.ctc = ctc
      if report_bleu:
          self.error_calculator = ASRErrorCalculator(
              token_list, sym_space, sym_blank, True, True
          )
  
      if not hasattr(self.encoder, "interctc_use_conditioning"):
          self.encoder.interctc_use_conditioning = False
      if self.encoder.interctc_use_conditioning:
          self.encoder.conditioning_layer = torch.nn.Linear(
              vocab_size, self.encoder.output_size()
          )
  
imports: from contextlib import contextmanager
  from typing import Dict, List, Optional, Tuple, Union
  import torch
  from packaging.version import parse
  from typeguard import check_argument_types
  from espnet2.asr.ctc import CTC
  from espnet2.asr.decoder.abs_decoder import AbsDecoder
  from espnet2.asr.encoder.abs_encoder import AbsEncoder
  from espnet2.asr.frontend.abs_frontend import AbsFrontend
  from espnet2.asr.postencoder.abs_postencoder import AbsPostEncoder
  from espnet2.asr.preencoder.abs_preencoder import AbsPreEncoder
  from espnet2.asr.specaug.abs_specaug import AbsSpecAug
  from espnet2.mt.espnet_model import ESPnetMTModel
  from espnet2.torch_utils.device_funcs import force_gatherable
  from espnet.nets.e2e_asr_common import ErrorCalculator
  from espnet.nets.pytorch_backend.nets_utils import th_accuracy
  from espnet.nets.pytorch_backend.transformer.add_sos_eos import add_sos_eos
label_desc: Use image node_id 1 to create a new ESPnetDiscreteASRModel object from inherited base classes: ESPnetMTModel with example: obj = ESPnetDiscreteASRModel(vocab_size, token_list, frontend, specaug, preencoder, encoder, postencoder, decoder, ctc, ctc_weight, interctc_weight, src_vocab_size, src_token_list, ignore_id, lsm_weight, length_normalized_loss, report_bleu, sym_space, sym_blank, extract_feats_in_collect_stats, share_decoder_input_output_embed, share_encoder_decoder_input_embed)