class_docstr: ASR model wrapper to perform alignment building.
  Functionality is limited to the components needed to build an alignment.
docstr: Part of __init__ intended to initialize attributes specific to the alignment type for RNNT models.
  
  This method is not supposed to be called outside of __init__.
docstr_tok: ["Part","of","__init__","intended","to","initialize","attributes","specific","to","the","alignment","type","for","RNNT","models",".","This","method","is","not","supposed","to","be","called","outside","of","__init__","."]
code: def _init_rnnt_alignment_specific(self, cfg: DictConfig):
      """Part of __init__ intended to initialize attributes specific to the alignment type for RNNT models.
  
      This method is not supposed to be called outside of __init__.
      """
      if self.alignment_type == "argmax":
          return
  
      from nemo.collections.asr.modules.graph_decoder import (
          ViterbiDecoderWithGraph,
      )
  
      if self.alignment_type == "forced":
          self.predictor_window_size = cfg.rnnt_cfg.get(
              "predictor_window_size", 0
          )
          self.predictor_step_size = cfg.rnnt_cfg.get(
              "predictor_step_size", 0
          )
  
          from nemo.collections.asr.parts.k2.utils import (
              apply_rnnt_prune_ranges,
              get_uniform_rnnt_prune_ranges,
          )
  
          self.prepare_pruned_outputs = lambda encoder_outputs, encoded_len, decoder_outputs, transcript_len: apply_rnnt_prune_ranges(
              encoder_outputs,
              decoder_outputs,
              get_uniform_rnnt_prune_ranges(
                  encoded_len,
                  transcript_len,
                  self.predictor_window_size + 1,
                  self.predictor_step_size,
                  encoder_outputs.size(1),
              ).to(device=encoder_outputs.device),
          )
  
          from nemo.collections.asr.parts.k2.classes import (
              GraphModuleConfig,
          )
  
          self.graph_decoder = ViterbiDecoderWithGraph(
              num_classes=self.blank_id,
              backend="k2",
              dec_type="topo_rnnt_ali",
              split_batch_size=self.decode_batch_size,
              graph_module_cfg=OmegaConf.structured(
                  GraphModuleConfig(
                      topo_type="minimal",
                      predictor_window_size=self.predictor_window_size,
                      predictor_step_size=self.predictor_step_size,
                  )
              ),
          )
          # override decoder args if a config is provided
          decoder_module_cfg = cfg.get("decoder_module_cfg", None)
          if decoder_module_cfg is not None:
              self.graph_decoder._decoder.intersect_pruned = (
                  decoder_module_cfg.get("intersect_pruned")
              )
              self.graph_decoder._decoder.intersect_conf = (
                  decoder_module_cfg.get("intersect_conf")
              )
          return
  
imports: import copy
  import os
  from typing import Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  from omegaconf import DictConfig, OmegaConf, open_dict
  from tqdm.auto import tqdm
  from nemo.collections.asr.data.audio_to_ctm_dataset import FrameCtmUnit
  from nemo.collections.asr.data.audio_to_text_dali import DALIOutputs
  from nemo.collections.asr.models.asr_model import ASRModel
  from nemo.utils import logging
label_desc: Use image node_id 3 for calling the AlignerWrapperModel obj's underlying member method code with example usage: obj._init_rnnt_alignment_specific(cfg) without return types