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 CTC 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","CTC","models",".","This","method","is","not","supposed","to","be","called","outside","of","__init__","."]
code: def _init_ctc_alignment_specific(self, cfg: DictConfig):
      """Part of __init__ intended to initialize attributes specific to the alignment type for CTC models.
  
      This method is not supposed to be called outside of __init__.
      """
      # do nothing for regular CTC with `argmax` alignment type
      if self.alignment_type == "argmax" and not hasattr(
          self._model, "use_graph_lm"
      ):
          return
  
      from nemo.collections.asr.modules.graph_decoder import (
          ViterbiDecoderWithGraph,
      )
  
      if self.alignment_type == "forced":
          if hasattr(self._model, "use_graph_lm"):
              if self._model.use_graph_lm:
                  self.graph_decoder = self._model.transcribe_decoder
                  self._model.use_graph_lm = False
              else:
                  self.graph_decoder = ViterbiDecoderWithGraph(
                      num_classes=self.blank_id,
                      backend="k2",
                      dec_type="topo",
                      return_type="1best",
                  )
              # override split_batch_size
              self.graph_decoder.split_batch_size = (
                  self.decode_batch_size
              )
          else:
              self.graph_decoder = ViterbiDecoderWithGraph(
                  num_classes=self.blank_id,
                  split_batch_size=self.decode_batch_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
  
      if self.alignment_type == "argmax":
          # we use transcribe_decoder to get topology-independent output
          if not self._model.use_graph_lm:
              self._model.transcribe_decoder = ViterbiDecoderWithGraph(
                  num_classes=self.blank_id,
                  backend="k2",
                  dec_type="topo",
                  return_type="1best",
              )
          # override decoder args
          self._model.transcribe_decoder.return_ilabels = False
          self._model.transcribe_decoder.output_aligned = True
          self._model.transcribe_decoder.split_batch_size = (
              self.decode_batch_size
          )
          self._model.use_graph_lm = False
          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 2 for calling the AlignerWrapperModel obj's underlying member method code with example usage: obj._init_ctc_alignment_specific(cfg) without return types