class_docstr: Base class for graph transducer losses.
  Implementation of the approach described in "Powerful and Extensible WFST Framework for RNN-Transducer Losses"
  https://ieeexplore.ieee.org/document/10096679
  
  Compose-Transducer: compose the unit (target text) and temporal schemas (graphs) into lattice.
      Subclass should implement `get_unit_schema` and `get_temporal_schema` methods.
  Grid-Transducer: construct the RNN-T lattice (grid) directly in code.
      Subclass should implement `get_grid` method.
docstr: Get composed lattice (unit and temporal schemas) for Compose-Transducer. Useful for visualization.
  Should be equivalent to the lattice from `get_grid` method.
  
  Args:
      units_tensor: tensor with target text
      num_frames: length of the sequence (in frames)
      vocab_size: vocab size (including blank)
  
  Returns:
      composed lattice (k2.Fsa) from unit and temporal schemas
docstr_tok: ["Get","composed","lattice","(","unit","and","temporal","schemas",")","for","Compose-Transducer",".","Useful","for","visualization",".","Should","be","equivalent","to","the","lattice","from","`","get_grid","`","method",".","Args",":","units_tensor",":","tensor","with","target","text","num_frames",":","length","of","the","sequence","(","in","frames",")","vocab_size",":","vocab","size","(","including","blank",")","Returns",":","composed","lattice","(","k2.Fsa",")","from","unit","and","temporal","schemas"]
code: def get_composed_lattice(
      self, units_tensor: torch.Tensor, num_frames: int, vocab_size: int
  ) -> "k2.Fsa":
      """
      Get composed lattice (unit and temporal schemas) for Compose-Transducer. Useful for visualization.
      Should be equivalent to the lattice from `get_grid` method.
  
      Args:
          units_tensor: tensor with target text
          num_frames: length of the sequence (in frames)
          vocab_size: vocab size (including blank)
  
      Returns:
          composed lattice (k2.Fsa) from unit and temporal schemas
      """
      fsa_text = self.get_unit_schema(units_tensor, vocab_size)
      fsa_temporal = self.get_temporal_schema(
          num_frames, vocab_size, units_tensor.device
      )
      composed = k2.compose(
          fsa_text, fsa_temporal, treat_epsilons_specially=False
      )
      if self.connect_composed:
          composed = k2.connect(composed)
      return composed
  
imports: import abc
  from contextlib import nullcontext
  from typing import ContextManager
  import torch
  import torch.nn.functional
  from nemo.core.classes.loss import Loss
  from nemo.core.utils.k2_guard import k2
label_desc: Use image node_id 5 for calling the GraphTransducerLossBase obj's underlying member method code with example usage: obj.get_composed_lattice(units_tensor, num_frames, vocab_size) and returns: composed