class_docstr: Base class for encoder decoder RNNT-based models.
docstr: Helper method to extract the rnnt loss name, and potentially its kwargs
  to be passed.
  
  Args:
      cfg: Should contain `loss_name` as a string which is resolved to a RNNT loss name.
          If the default should be used, then `default` can be used.
          Optionally, one can pass additional kwargs to the loss function. The subdict
          should have a keyname as follows : `{loss_name}_kwargs`.
  
          Note that whichever loss_name is selected, that corresponding kwargs will be
          selected. For the "default" case, the "{resolved_default}_kwargs" will be used.
  
  Examples:
      .. code-block:: yaml
  
          loss_name: "default"
          warprnnt_numba_kwargs:
              kwargs2: some_other_val
  
  Returns:
      A tuple, the resolved loss name as well as its kwargs (if found).
docstr_tok: ["Helper","method","to","extract","the","rnnt","loss","name",",","and","potentially","its","kwargs","to","be","passed",".","Args",":","cfg",":","Should","contain","`","loss_name","`","as","a","string","which","is","resolved","to","a","RNNT","loss","name",".","If","the","default","should","be","used",",","then","`","default","`","can","be","used",".","Optionally",",","one","can","pass","additional","kwargs","to","the","loss","function",".","The","subdict","should","have","a","keyname","as","follows",":","`","{","loss_name","}","_kwargs","`",".","Note","that","whichever","loss_name","is","selected",",","that","corresponding","kwargs","will","be","selected",".","For","the","``","default","''","case",",","the","``","{","resolved_default","}","_kwargs","''","will","be","used",".","Examples",":","..","code-block",":",":","yaml","loss_name",":","``","default","''","warprnnt_numba_kwargs",":","kwargs2",":","some_other_val","Returns",":","A","tuple",",","the","resolved","loss","name","as","well","as","its","kwargs","(","if","found",")","."]
code: def extract_rnnt_loss_cfg(self, cfg: Optional[DictConfig]):
      """
      Helper method to extract the rnnt loss name, and potentially its kwargs
      to be passed.
  
      Args:
          cfg: Should contain `loss_name` as a string which is resolved to a RNNT loss name.
              If the default should be used, then `default` can be used.
              Optionally, one can pass additional kwargs to the loss function. The subdict
              should have a keyname as follows : `{loss_name}_kwargs`.
  
              Note that whichever loss_name is selected, that corresponding kwargs will be
              selected. For the "default" case, the "{resolved_default}_kwargs" will be used.
  
      Examples:
          .. code-block:: yaml
  
              loss_name: "default"
              warprnnt_numba_kwargs:
                  kwargs2: some_other_val
  
      Returns:
          A tuple, the resolved loss name as well as its kwargs (if found).
      """
      if cfg is None:
          cfg = DictConfig({})
  
      loss_name = cfg.get("loss_name", "default")
  
      if loss_name == "default":
          loss_name = resolve_rnnt_default_loss_name()
  
      loss_kwargs = cfg.get(f"{loss_name}_kwargs", None)
  
      logging.info(
          f"Using RNNT Loss : {loss_name}\n"
          f"Loss {loss_name}_kwargs: {loss_kwargs}"
      )
  
      return loss_name, loss_kwargs
  
imports: import copy
  import json
  import os
  import tempfile
  from math import ceil
  from typing import Dict, List, Optional, Tuple, Union
  import torch
  from omegaconf import DictConfig, OmegaConf, open_dict
  from pytorch_lightning import Trainer
  from tqdm.auto import tqdm
  from nemo.collections.asr.data import audio_to_text_dataset
  from nemo.collections.asr.losses.rnnt import RNNTLoss, resolve_rnnt_default_loss_name
  from nemo.collections.asr.metrics.wer import WER
  from nemo.collections.asr.models.asr_model import ASRModel
  from nemo.collections.asr.modules.rnnt import RNNTDecoderJoint
  from nemo.collections.asr.parts.mixins import ASRModuleMixin
  from nemo.collections.asr.parts.submodules.rnnt_decoding import RNNTDecoding, RNNTDecodingConfig
  from nemo.collections.asr.parts.utils.audio_utils import ChannelSelectorType
  from nemo.collections.multimodal.speech_cv.data import video_to_text_dataset
  from nemo.core.classes import Exportable
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.core.classes.mixins import AccessMixin
  from nemo.core.neural_types import AcousticEncodedRepresentation, LengthsType, NeuralType, VideoSignal
  from nemo.utils import logging
label_desc: Use image node_id 3 for calling the VisualEncDecRNNTModel obj's underlying member method code with example usage: obj.extract_rnnt_loss_cfg(cfg) and returns: loss_name,  loss_kwargs