class_docstr: ESPnet2ASRTransducerModel module definition.
  
  Args:
      vocab_size: Size of complete vocabulary (w/ SOS/EOS and blank included).
      token_list: List of tokens in vocabulary (minus reserved tokens).
      frontend: Frontend module.
      specaug: SpecAugment module.
      normalize: Normalization module.
      encoder: Encoder module.
      decoder: Decoder module.
      joint_network: Joint Network module.
      transducer_weight: Weight of the Transducer loss.
      use_k2_pruned_loss: Whether to use k2 pruned Transducer loss.
      k2_pruned_loss_args: Arguments of the k2 loss pruned Transducer loss.
      warmup_steps: Number of steps in warmup, used for pruned loss scaling.
      validation_nstep: Maximum number of symbol expansions at each time step
                        when reporting CER or/and WER using mAES.
      fastemit_lambda: FastEmit lambda value.
      auxiliary_ctc_weight: Weight of auxiliary CTC loss.
      auxiliary_ctc_dropout_rate: Dropout rate for auxiliary CTC loss inputs.
      auxiliary_lm_loss_weight: Weight of auxiliary LM loss.
      auxiliary_lm_loss_smoothing: Smoothing rate for LM loss' label smoothing.
      ignore_id: Initial padding ID.
      sym_space: Space symbol.
      sym_blank: Blank Symbol.
      report_cer: Whether to report Character Error Rate during validation.
      report_wer: Whether to report Word Error Rate during validation.
      extract_feats_in_collect_stats: Whether to use extract_feats stats collection.
class_docstr_tok: ["ESPnet2ASRTransducerModel","module","definition",".","Args",":","vocab_size",":","Size","of","complete","vocabulary","(","w\/","SOS\/EOS","and","blank","included",")",".","token_list",":","List","of","tokens","in","vocabulary","(","minus","reserved","tokens",")",".","frontend",":","Frontend","module",".","specaug",":","SpecAugment","module",".","normalize",":","Normalization","module",".","encoder",":","Encoder","module",".","decoder",":","Decoder","module",".","joint_network",":","Joint","Network","module",".","transducer_weight",":","Weight","of","the","Transducer","loss",".","use_k2_pruned_loss",":","Whether","to","use","k2","pruned","Transducer","loss",".","k2_pruned_loss_args",":","Arguments","of","the","k2","loss","pruned","Transducer","loss",".","warmup_steps",":","Number","of","steps","in","warmup",",","used","for","pruned","loss","scaling",".","validation_nstep",":","Maximum","number","of","symbol","expansions","at","each","time","step","when","reporting","CER","or\/and","WER","using","mAES",".","fastemit_lambda",":","FastEmit","lambda","value",".","auxiliary_ctc_weight",":","Weight","of","auxiliary","CTC","loss",".","auxiliary_ctc_dropout_rate",":","Dropout","rate","for","auxiliary","CTC","loss","inputs",".","auxiliary_lm_loss_weight",":","Weight","of","auxiliary","LM","loss",".","auxiliary_lm_loss_smoothing",":","Smoothing","rate","for","LM","loss","'","label","smoothing",".","ignore_id",":","Initial","padding","ID",".","sym_space",":","Space","symbol",".","sym_blank",":","Blank","Symbol",".","report_cer",":","Whether","to","report","Character","Error","Rate","during","validation",".","report_wer",":","Whether","to","report","Word","Error","Rate","during","validation",".","extract_feats_in_collect_stats",":","Whether","to","use","extract_feats","stats","collection","."]
docstr: Construct an ESPnetASRTransducerModel object.
docstr_tok: ["Construct","an","ESPnetASRTransducerModel","object","."]
code: def __init__(
      self,
      vocab_size: int,
      token_list: Union[Tuple[str, ...], List[str]],
      frontend: Optional[AbsFrontend],
      specaug: Optional[AbsSpecAug],
      normalize: Optional[AbsNormalize],
      encoder: Encoder,
      decoder: AbsDecoder,
      joint_network: JointNetwork,
      transducer_weight: float = 1.0,
      use_k2_pruned_loss: bool = False,
      k2_pruned_loss_args: Dict = {},
      warmup_steps: int = 25000,
      validation_nstep: int = 2,
      fastemit_lambda: float = 0.0,
      auxiliary_ctc_weight: float = 0.0,
      auxiliary_ctc_dropout_rate: float = 0.0,
      auxiliary_lm_loss_weight: float = 0.0,
      auxiliary_lm_loss_smoothing: float = 0.05,
      ignore_id: int = -1,
      sym_space: str = "<space>",
      sym_blank: str = "<blank>",
      report_cer: bool = False,
      report_wer: bool = False,
      extract_feats_in_collect_stats: bool = True,
  ) -> None:
      """Construct an ESPnetASRTransducerModel object."""
      super().__init__()
  
      assert check_argument_types()
  
      # The following labels ID are reserved:
      #    - 0: Blank symbol.
      #    - 1: Unknown symbol.
      #    - vocab_size - 1: SOS/EOS symbol.
      self.vocab_size = vocab_size
      self.ignore_id = ignore_id
      self.token_list = token_list.copy()
  
      self.sym_space = sym_space
      self.sym_blank = sym_blank
  
      self.frontend = frontend
      self.specaug = specaug
      self.normalize = normalize
  
      self.encoder = encoder
      self.decoder = decoder
      self.joint_network = joint_network
  
      self.criterion_transducer = None
      self.error_calculator = None
  
      self.use_auxiliary_ctc = auxiliary_ctc_weight > 0
      self.use_auxiliary_lm_loss = auxiliary_lm_loss_weight > 0
  
      if use_k2_pruned_loss:
          self.am_proj = torch.nn.Linear(
              encoder.output_size,
              vocab_size,
          )
  
          self.lm_proj = torch.nn.Linear(
              decoder.output_size,
              vocab_size,
          )
  
          self.warmup_steps = warmup_steps
          self.steps_num = -1
  
          self.k2_pruned_loss_args = k2_pruned_loss_args
          self.k2_loss_type = k2_pruned_loss_args.get(
              "loss_type", "regular"
          )
  
      self.use_k2_pruned_loss = use_k2_pruned_loss
  
      if self.use_auxiliary_ctc:
          self.ctc_lin = torch.nn.Linear(
              encoder.output_size, vocab_size
          )
          self.ctc_dropout_rate = auxiliary_ctc_dropout_rate
  
      if self.use_auxiliary_lm_loss:
          self.lm_lin = torch.nn.Linear(decoder.output_size, vocab_size)
  
          eps = auxiliary_lm_loss_smoothing / (vocab_size - 1)
  
          self.lm_loss_smooth_neg = eps
          self.lm_loss_smooth_pos = (
              1 - auxiliary_lm_loss_smoothing
          ) + eps
  
      self.transducer_weight = transducer_weight
      self.fastemit_lambda = fastemit_lambda
  
      self.auxiliary_ctc_weight = auxiliary_ctc_weight
      self.auxiliary_lm_loss_weight = auxiliary_lm_loss_weight
  
      self.report_cer = report_cer
      self.report_wer = report_wer
      self.validation_nstep = validation_nstep
  
      self.extract_feats_in_collect_stats = (
          extract_feats_in_collect_stats
      )
  
imports: import logging
  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.frontend.abs_frontend import AbsFrontend
  from espnet2.asr.specaug.abs_specaug import AbsSpecAug
  from espnet2.asr_transducer.decoder.abs_decoder import AbsDecoder
  from espnet2.asr_transducer.encoder.encoder import Encoder
  from espnet2.asr_transducer.joint_network import JointNetwork
  from espnet2.asr_transducer.utils import get_transducer_task_io
  from espnet2.layers.abs_normalize import AbsNormalize
  from espnet2.torch_utils.device_funcs import force_gatherable
  from espnet2.train.abs_espnet_model import AbsESPnetModel
label_desc: Use image node_id 1 to create a new ESPnetASRTransducerModel object from inherited base classes: AbsESPnetModel with example: obj = ESPnetASRTransducerModel(vocab_size, token_list, frontend, specaug, normalize, encoder, decoder, joint_network, transducer_weight, use_k2_pruned_loss, k2_pruned_loss_args, warmup_steps, validation_nstep, fastemit_lambda, auxiliary_ctc_weight, auxiliary_ctc_dropout_rate, auxiliary_lm_loss_weight, auxiliary_lm_loss_smoothing, ignore_id, sym_space, sym_blank, report_cer, report_wer, extract_feats_in_collect_stats)