class_docstr: Base class for hybrid RNNT/CTC models.
docstr: Changes decoding strategy used during RNNT decoding process.
  
  Args:
      decoding_cfg: A config for the decoder, which is optional. If the decoding type
          needs to be changed (from say Greedy to Beam decoding etc), the config can be passed here.
      decoder_type: (str) Can be set to 'rnnt' or 'ctc' to switch between appropriate decoder in a
          model having RNN-T and CTC decoders. Defaults to None, in which case RNN-T decoder is
          used. If set to 'ctc', it raises error if 'ctc_decoder' is not an attribute of the model.
docstr_tok: ["Changes","decoding","strategy","used","during","RNNT","decoding","process",".","Args",":","decoding_cfg",":","A","config","for","the","decoder",",","which","is","optional",".","If","the","decoding","type","needs","to","be","changed","(","from","say","Greedy","to","Beam","decoding","etc",")",",","the","config","can","be","passed","here",".","decoder_type",":","(","str",")","Can","be","set","to","'rnnt","'","or","'ctc","'","to","switch","between","appropriate","decoder","in","a","model","having","RNN-T","and","CTC","decoders",".","Defaults","to","None",",","in","which","case","RNN-T","decoder","is","used",".","If","set","to","'ctc","'",",","it","raises","error","if","'ctc_decoder","'","is","not","an","attribute","of","the","model","."]
code: def change_decoding_strategy(
      self, decoding_cfg: DictConfig = None, decoder_type: str = None
  ):
      """
      Changes decoding strategy used during RNNT decoding process.
  
      Args:
          decoding_cfg: A config for the decoder, which is optional. If the decoding type
              needs to be changed (from say Greedy to Beam decoding etc), the config can be passed here.
          decoder_type: (str) Can be set to 'rnnt' or 'ctc' to switch between appropriate decoder in a
              model having RNN-T and CTC decoders. Defaults to None, in which case RNN-T decoder is
              used. If set to 'ctc', it raises error if 'ctc_decoder' is not an attribute of the model.
      """
      if decoder_type is None or decoder_type == "rnnt":
          self.cur_decoder = "rnnt"
          return super().change_decoding_strategy(
              decoding_cfg=decoding_cfg
          )
  
      assert decoder_type == "ctc" and hasattr(self, "ctc_decoder")
      if decoding_cfg is None:
          # Assume same decoding config as before
          logging.info(
              "No `decoding_cfg` passed when changing decoding strategy, using internal config"
          )
          decoding_cfg = self.cfg.aux_ctc.decoding
  
      # Assert the decoding config with all hyper parameters
      decoding_cls = OmegaConf.structured(CTCDecodingConfig)
      decoding_cls = OmegaConf.create(
          OmegaConf.to_container(decoding_cls)
      )
      decoding_cfg = OmegaConf.merge(decoding_cls, decoding_cfg)
  
      self.ctc_decoding = CTCDecoding(
          decoding_cfg=decoding_cfg,
          vocabulary=self.ctc_decoder.vocabulary,
      )
  
      self.ctc_wer = WER(
          decoding=self.ctc_decoding,
          use_cer=self.ctc_wer.use_cer,
          log_prediction=self.ctc_wer.log_prediction,
          dist_sync_on_step=True,
      )
  
      self.ctc_decoder.temperature = decoding_cfg.get(
          "temperature", 1.0
      )
  
      # Update config
      with open_dict(self.cfg.aux_ctc):
          self.cfg.aux_ctc.decoding = decoding_cfg
  
      self.cur_decoder = "ctc"
      logging.info(
          f"Changed decoding strategy to \n{OmegaConf.to_yaml(self.cfg.aux_ctc.decoding)}"
      )
  
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 4 for calling the EncDecHybridRNNTCTCModel obj's underlying member method code with example usage: obj.change_decoding_strategy(decoding_cfg, decoder_type) and returns: super