class_docstr: Base class for hybrid RNNT/CTC models.
code: def __init__(self, cfg: DictConfig, trainer: Trainer = None):
      cfg = model_utils.convert_model_config_to_dict_config(cfg)
      cfg = model_utils.maybe_update_config_version(cfg)
      super().__init__(cfg=cfg, trainer=trainer)
  
      if "aux_ctc" not in self.cfg:
          raise ValueError(
              "The config need to have a section for the CTC decoder named as aux_ctc for Hybrid models."
          )
      with open_dict(self.cfg.aux_ctc):
          if "feat_in" not in self.cfg.aux_ctc.decoder or (
              not self.cfg.aux_ctc.decoder.feat_in
              and hasattr(self.encoder, "_feat_out")
          ):
              self.cfg.aux_ctc.decoder.feat_in = self.encoder._feat_out
          if (
              "feat_in" not in self.cfg.aux_ctc.decoder
              or not self.cfg.aux_ctc.decoder.feat_in
          ):
              raise ValueError(
                  "param feat_in of the decoder's config is not set!"
              )
  
          if (
              self.cfg.aux_ctc.decoder.num_classes < 1
              and self.cfg.aux_ctc.decoder.vocabulary is not None
          ):
              logging.info(
                  "\nReplacing placeholder number of classes ({}) with actual number of classes - {}".format(
                      self.cfg.aux_ctc.decoder.num_classes,
                      len(self.cfg.aux_ctc.decoder.vocabulary),
                  )
              )
              self.cfg.aux_ctc.decoder["num_classes"] = len(
                  self.cfg.aux_ctc.decoder.vocabulary
              )
  
      self.ctc_decoder = EncDecRNNTModel.from_config_dict(
          self.cfg.aux_ctc.decoder
      )
      self.ctc_loss_weight = self.cfg.aux_ctc.get(
          "ctc_loss_weight", 0.5
      )
  
      self.ctc_loss = CTCLoss(
          num_classes=self.ctc_decoder.num_classes_with_blank - 1,
          zero_infinity=True,
          reduction=self.cfg.aux_ctc.get("ctc_reduction", "mean_batch"),
      )
  
      ctc_decoding_cfg = self.cfg.aux_ctc.get("decoding", None)
      if ctc_decoding_cfg is None:
          ctc_decoding_cfg = OmegaConf.structured(CTCDecodingConfig)
          with open_dict(self.cfg.aux_ctc):
              self.cfg.aux_ctc.decoding = ctc_decoding_cfg
  
      self.ctc_decoding = CTCDecoding(
          self.cfg.aux_ctc.decoding,
          vocabulary=self.ctc_decoder.vocabulary,
      )
      self.ctc_wer = WER(
          decoding=self.ctc_decoding,
          use_cer=self.cfg.aux_ctc.get("use_cer", False),
          dist_sync_on_step=True,
          log_prediction=self.cfg.get("log_prediction", False),
      )
  
      # setting the RNNT decoder as the default one
      self.cur_decoder = "rnnt"
  
      # setting up interCTC loss (from InterCTCMixin)
      self.setup_interctc(
          decoder_name="ctc_decoder",
          loss_name="ctc_loss",
          wer_name="ctc_wer",
      )
  
imports: import copy
  import json
  import os
  import tempfile
  from typing import List, Optional
  import torch
  from omegaconf import DictConfig, OmegaConf, open_dict
  from pytorch_lightning import Trainer
  from tqdm.auto import tqdm
  from nemo.collections.asr.data.audio_to_text_dali import DALIOutputs
  from nemo.collections.asr.losses.ctc import CTCLoss
  from nemo.collections.asr.metrics.wer import WER
  from nemo.collections.asr.models.rnnt_models import EncDecRNNTModel
  from nemo.collections.asr.parts.mixins import ASRBPEMixin, InterCTCMixin
  from nemo.collections.asr.parts.submodules.ctc_decoding import CTCDecoding, CTCDecodingConfig
  from nemo.collections.asr.parts.utils.audio_utils import ChannelSelectorType
  from nemo.core.classes.common import PretrainedModelInfo
  from nemo.core.classes.mixins import AccessMixin
  from nemo.utils import logging, model_utils
label_desc: Use image node_id 1 to create a new EncDecHybridRNNTCTCModel object from inherited base classes: EncDecRNNTModel, ASRBPEMixin, InterCTCMixin with example: obj = EncDecHybridRNNTCTCModel(cfg, trainer)