class_docstr: CTC-attention hybrid Encoder-Decoder model
class_docstr_tok: ["CTC-attention","hybrid","Encoder-Decoder","model"]
code: def __init__(
      self,
      vocab_size: int,
      token_list: Union[Tuple[str, ...], List[str]],
      frontend: Optional[AbsFrontend],
      specaug: Optional[AbsSpecAug],
      normalize: Optional[AbsNormalize],
      preencoder: Optional[AbsPreEncoder],
      encoder: AbsEncoder,
      postencoder: Optional[AbsPostEncoder],
      decoder: Optional[AbsDecoder],
      ctc: CTC,
      joint_network: Optional[torch.nn.Module],
      ctc_weight: float = 0.5,
      interctc_weight: float = 0.0,
      ignore_id: int = -1,
      lsm_weight: float = 0.0,
      length_normalized_loss: bool = False,
      report_cer: bool = True,
      report_wer: bool = True,
      sym_space: str = "<space>",
      sym_blank: str = "<blank>",
      # In a regular ESPnet recipe, <sos> and <eos> are both "<sos/eos>"
      # Pretrained HF Tokenizer needs custom sym_sos and sym_eos
      sym_sos: str = "<sos/eos>",
      sym_eos: str = "<sos/eos>",
      extract_feats_in_collect_stats: bool = True,
      lang_token_id: int = -1,
      # num_inf: the number of inferences (= number of outputs of the model)
      # num_ref: the number of references (= number of groundtruth seqs)
      num_inf: int = 1,
      num_ref: int = 1,
  ):
      assert check_argument_types()
      assert 0.0 < ctc_weight <= 1.0, ctc_weight
      assert (
          interctc_weight == 0.0
      ), "interctc is not supported for multispeaker ASR"
  
      super(ESPnetASRModel, self).__init__(
          vocab_size=vocab_size,
          token_list=token_list,
          frontend=frontend,
          specaug=specaug,
          normalize=normalize,
          preencoder=preencoder,
          encoder=encoder,
          postencoder=postencoder,
          decoder=decoder,
          ctc=ctc,
          joint_network=joint_network,
          ctc_weight=ctc_weight,
          interctc_weight=interctc_weight,
          ignore_id=ignore_id,
          lsm_weight=lsm_weight,
          length_normalized_loss=length_normalized_loss,
          report_cer=report_cer,
          report_wer=report_wer,
          sym_space=sym_space,
          sym_blank=sym_blank,
          sym_sos=sym_sos,
          sym_eos=sym_eos,
          extract_feats_in_collect_stats=extract_feats_in_collect_stats,
          lang_token_id=lang_token_id,
      )
  
      assert (
          num_inf == num_ref
      ), "Current PIT loss wrapper requires num_inf=num_ref"
      self.num_inf = num_inf
      self.num_ref = num_ref
  
      self.pit_ctc = PITLossWrapper(
          criterion_fn=self.ctc, num_ref=num_ref
      )
  
imports: import itertools
  from collections import defaultdict
  from contextlib import contextmanager
  from typing import Callable, 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.espnet_model import ESPnetASRModel
  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.enh.loss.wrappers.abs_wrapper import AbsLossWrapper
  from espnet2.layers.abs_normalize import AbsNormalize
  from espnet2.torch_utils.device_funcs import force_gatherable
label_desc: Use image node_id 1 to create a new ESPnetASRModel object from inherited base classes: SingleESPnetASRModel with example: obj = ESPnetASRModel(vocab_size, token_list, frontend, specaug, normalize, preencoder, encoder, postencoder, decoder, ctc, joint_network, ctc_weight, interctc_weight, ignore_id, lsm_weight, length_normalized_loss, report_cer, report_wer, sym_space, sym_blank, sym_sos, sym_eos, extract_feats_in_collect_stats, lang_token_id, num_inf, num_ref)