class_docstr: k2 Mixin class that simplifies the construction of various k2-based CTC-like losses.
  
  It does the following:
      -   Prepares and adapts the input tensors (method _prepare_log_probs_and_targets).
      -   Creates Emissions graphs (method _prepare_emissions_graphs).
      -   Extracts the labels and probabilities of the best lattice path (method _extract_labels_and_probabilities).
class_docstr_tok: ["k2","Mixin","class","that","simplifies","the","construction","of","various","k2-based","CTC-like","losses",".","It","does","the","following",":","-","Prepares","and","adapts","the","input","tensors","(","method","_prepare_log_probs_and_targets",")",".","-","Creates","Emissions","graphs","(","method","_prepare_emissions_graphs",")",".","-","Extracts","the","labels","and","probabilities","of","the","best","lattice","path","(","method","_extract_labels_and_probabilities",")","."]
docstr: Creates DenseFsaVec, padding it with <epsilon> frames if the topology is `compact`.
  In particular, every second frame of the DenseFsaVec is the <epsilon> frame.
  
  <epsilon> frame is a frame with <epsilon> log-probability zero and every other log-probability is -inf.
docstr_tok: ["Creates","DenseFsaVec",",","padding","it","with","<","epsilon",">","frames","if","the","topology","is","`","compact","`",".","In","particular",",","every","second","frame","of","the","DenseFsaVec","is","the","<","epsilon",">","frame",".","<","epsilon",">","frame","is","a","frame","with","<","epsilon",">","log-probability","zero","and","every","other","log-probability","is","-inf","."]
code: def _prepare_emissions_graphs(
      self, log_probs: torch.Tensor, supervisions: torch.Tensor
  ) -> "k2.DenseFsaVec":
      """Creates DenseFsaVec, padding it with <epsilon> frames if the topology is `compact`.
      In particular, every second frame of the DenseFsaVec is the <epsilon> frame.
  
      <epsilon> frame is a frame with <epsilon> log-probability zero and every other log-probability is -inf.
      """
      return (
          prep_padded_densefsavec(log_probs, supervisions)
          if self.pad_fsavec
          else k2.DenseFsaVec(log_probs, supervisions)
      )
  
file_path: NeMo/nemo/collections/asr/parts/k2/loss_mixins.py
imports: from abc import ABC
  from typing import List, Optional, Tuple
  import torch
  from nemo.collections.asr.parts.k2.grad_utils import GradExpNormalize
  from nemo.collections.asr.parts.k2.utils import create_supervision, get_arc_weights, get_uniform_rnnt_prune_ranges, make_non_pad_mask, make_non_pad_mask_3d, prep_padded_densefsavec
  from nemo.core.utils.k2_guard import k2
label_desc: Use image node_id 2 for calling the CtcK2Mixin obj's underlying member method code with example usage: obj._prepare_emissions_graphs(log_probs, supervisions) and returns: unknown