class_docstr: W-Transducer loss: RNN-T loss modification for training RNN-T model for the case
  when some text at the beginning/end of the utterance is missing.
  The resulting model behaves like the RNN-T model (no modification for decoding is required).
  For details see "Powerful and Extensible WFST Framework for RNN-Transducer Losses" paper
      https://ieeexplore.ieee.org/document/10096679
class_docstr_tok: ["W-Transducer","loss",":","RNN-T","loss","modification","for","training","RNN-T","model","for","the","case","when","some","text","at","the","beginning\/end","of","the","utterance","is","missing",".","The","resulting","model","behaves","like","the","RNN-T","model","(","no","modification","for","decoding","is","required",")",".","For","details","see","``","Powerful","and","Extensible","WFST","Framework","for","RNN-Transducer","Losses","''","paper","https",":","\/\/ieeexplore.ieee.org\/document\/10096679"]
docstr: Init method
  
  Args:
      blank: blank label index
      eps_weight: weight of epsilon transitions, 0 means no penalty (default)
      last_blank_mode: allow to skip last blank in the prediction (default) or force it
      use_grid_implementation: Whether to use the grid implementation (Grid-Transducer).
      connect_composed: Connect graph after composing unit and temporal schemas
          (only for Compose-Transducer). `connect` operation is slow, it is useful for visualization,
          but not necessary for loss computation.
      double_scores: Use calculation of loss in double precision (float64) in the lattice.
          Does not significantly affect memory usage since the lattice is ~V/2 times smaller than the joint tensor.
      cast_to_float32: Force cast joint tensor to float32 before log-softmax calculation.
docstr_tok: ["Init","method","Args",":","blank",":","blank","label","index","eps_weight",":","weight","of","epsilon","transitions",",","0","means","no","penalty","(","default",")","last_blank_mode",":","allow","to","skip","last","blank","in","the","prediction","(","default",")","or","force","it","use_grid_implementation",":","Whether","to","use","the","grid","implementation","(","Grid-Transducer",")",".","connect_composed",":","Connect","graph","after","composing","unit","and","temporal","schemas","(","only","for","Compose-Transducer",")",".","`","connect","`","operation","is","slow",",","it","is","useful","for","visualization",",","but","not","necessary","for","loss","computation",".","double_scores",":","Use","calculation","of","loss","in","double","precision","(","float64",")","in","the","lattice",".","Does","not","significantly","affect","memory","usage","since","the","lattice","is","~V\/2","times","smaller","than","the","joint","tensor",".","cast_to_float32",":","Force","cast","joint","tensor","to","float32","before","log-softmax","calculation","."]
code: def __init__(
      self,
      blank: int,
      eps_weight: float = 0.0,
      last_blank_mode: Union[
          LastBlankMode, str
      ] = LastBlankMode.FORCE_FINAL,
      use_grid_implementation=True,
      connect_composed=False,
      double_scores=False,
      cast_to_float32=False,
  ):
      """
      Init method
  
      Args:
          blank: blank label index
          eps_weight: weight of epsilon transitions, 0 means no penalty (default)
          last_blank_mode: allow to skip last blank in the prediction (default) or force it
          use_grid_implementation: Whether to use the grid implementation (Grid-Transducer).
          connect_composed: Connect graph after composing unit and temporal schemas
              (only for Compose-Transducer). `connect` operation is slow, it is useful for visualization,
              but not necessary for loss computation.
          double_scores: Use calculation of loss in double precision (float64) in the lattice.
              Does not significantly affect memory usage since the lattice is ~V/2 times smaller than the joint tensor.
          cast_to_float32: Force cast joint tensor to float32 before log-softmax calculation.
      """
      super().__init__(
          blank=blank,
          use_grid_implementation=use_grid_implementation,
          connect_composed=connect_composed,
          double_scores=double_scores,
          cast_to_float32=cast_to_float32,
      )
      self.eps_weight = eps_weight
      self.last_blank_mode = self.LastBlankMode(last_blank_mode)
  
file_path: NeMo/nemo/collections/asr/parts/k2/w_transducer.py
imports: from contextlib import nullcontext
  from typing import Union
  import torch
  import torch.nn.functional
  from nemo.collections.asr.parts.k2.graph_transducer import GraphRnntLoss, force_float32_context
  from nemo.core.utils.k2_guard import k2
  from nemo.utils.enum import PrettyStrEnum
label_desc: Use image node_id 1 to create a new GraphWTransducerLoss object from inherited base classes: GraphRnntLoss with example: obj = GraphWTransducerLoss(blank, eps_weight, last_blank_mode, use_grid_implementation, connect_composed, double_scores, cast_to_float32)