class_docstr: Viterbi Decoder with WFSA (Weighted Finite State Automaton) graphs.
  
  Note:
      Requires k2 v1.14 or later to be installed to use this module.
  
  Decoder can be set up via the config, and optionally be passed keyword arguments as follows.
  
  Examples:
      .. code-block:: yaml
  
          model:  # Model config
              ...
              graph_module_cfg:  # Config for graph modules, e.g. ViterbiDecoderWithGraph
                  split_batch_size: 0
                  backend_cfg:
                      topo_type: "default"       # other options: "compact", "shared_blank", "minimal"
                      topo_with_self_loops: true
                      token_lm: <token_lm_path>  # must be provided for criterion_type: "map"
  
  Args:
      num_classes: Number of target classes for the decoder network to predict.
          (Excluding the blank token).
  
      backend: Which backend to use for decoding. Currently only `k2` is supported.
  
      dec_type: Type of decoding graph to use. Choices: `topo` and `token_lm`, 
          with `topo` standing for the loss topology graph only 
          and `token_lm` for the topology composed with a token_lm graph.
  
      return_type: Type of output. Choices: `1best` and `lattice`.
          `1best` is represented as a list of 1D tensors.
          `lattice` can be of type corresponding to the backend (e.g. k2.Fsa).
  
      return_ilabels: For return_type=`1best`.
          Whether to return input labels of a lattice (otherwise output labels).
  
      output_aligned: For return_type=`1best`.
          Whether the tensors length will correspond to log_probs_length 
          and the labels will be aligned to the frames of emission 
          (otherwise there will be only the necessary labels).
  
      split_batch_size: Local batch size. Used for memory consumption reduction at the cost of speed performance.
          Effective if complies 0 < split_batch_size < batch_size.
  
      graph_module_cfg: Optional Dict of (str, value) pairs that are passed to the backend graph decoder.
class_docstr_tok: ["Viterbi","Decoder","with","WFSA","(","Weighted","Finite","State","Automaton",")","graphs",".","Note",":","Requires","k2","v1.14","or","later","to","be","installed","to","use","this","module",".","Decoder","can","be","set","up","via","the","config",",","and","optionally","be","passed","keyword","arguments","as","follows",".","Examples",":","..","code-block",":",":","yaml","model",":","#","Model","config","...","graph_module_cfg",":","#","Config","for","graph","modules",",","e.g",".","ViterbiDecoderWithGraph","split_batch_size",":","0","backend_cfg",":","topo_type",":","``","default","''","#","other","options",":","``","compact","''",",","``","shared_blank","''",",","``","minimal","''","topo_with_self_loops",":","true","token_lm",":","<","token_lm_path",">","#","must","be","provided","for","criterion_type",":","``","map","''","Args",":","num_classes",":","Number","of","target","classes","for","the","decoder","network","to","predict",".","(","Excluding","the","blank","token",")",".","backend",":","Which","backend","to","use","for","decoding",".","Currently","only","`","k2","`","is","supported",".","dec_type",":","Type","of","decoding","graph","to","use",".","Choices",":","`","topo","`","and","`","token_lm","`",",","with","`","topo","`","standing","for","the","loss","topology","graph","only","and","`","token_lm","`","for","the","topology","composed","with","a","token_lm","graph",".","return_type",":","Type","of","output",".","Choices",":","`","1best","`","and","`","lattice","`",".","`","1best","`","is","represented","as","a","list","of","1D","tensors",".","`","lattice","`","can","be","of","type","corresponding","to","the","backend","(","e.g",".","k2.Fsa",")",".","return_ilabels",":","For","return_type=","`","1best","`",".","Whether","to","return","input","labels","of","a","lattice","(","otherwise","output","labels",")",".","output_aligned",":","For","return_type=","`","1best","`",".","Whether","the","tensors","length","will","correspond","to","log_probs_length","and","the","labels","will","be","aligned","to","the","frames","of","emission","(","otherwise","there","will","be","only","the","necessary","labels",")",".","split_batch_size",":","Local","batch","size",".","Used","for","memory","consumption","reduction","at","the","cost","of","speed","performance",".","Effective","if","complies","0","<","split_batch_size","<","batch_size",".","graph_module_cfg",":","Optional","Dict","of","(","str",",","value",")","pairs","that","are","passed","to","the","backend","graph","decoder","."]
docstr: Returns definitions of module input ports.
          
docstr_tok: ["Returns","definitions","of","module","input","ports","."]
code: def input_types(self):
      """Returns definitions of module input ports."""
      return {
          "log_probs": NeuralType(
              ("B", "T", "D")
              if self._3d_input
              else ("B", "T", "T", "D"),
              LogprobsType(),
          ),
          "input_lengths": NeuralType(tuple("B"), LengthsType()),
      }
  
file_path: NeMo/nemo/collections/asr/modules/graph_decoder.py
imports: from typing import Optional
  import torch
  from omegaconf import DictConfig
  from nemo.core.classes import NeuralModule
  from nemo.core.neural_types import LengthsType, LogprobsType, NeuralType, PredictionsType
label_desc: Use image node_id 1 for calling the ViterbiDecoderWithGraph obj's underlying member method code with example usage: obj.input_types() and returns: dict