class_docstr: RNN-T loss implementation based on WFST according
  to "Powerful and Extensible WFST Framework for RNN-Transducer Losses"
  https://ieeexplore.ieee.org/document/10096679
docstr: Compute forward method for RNN-T.
  
  Args:
      acts: activations (joint tensor). NB: raw logits, not after log-softmax
      labels: target labels
      act_lens: lengths of activations
      label_lens: length of labels sequences
  
  Returns:
      batch of RNN-T scores (loss)
docstr_tok: ["Compute","forward","method","for","RNN-T.","Args",":","acts",":","activations","(","joint","tensor",")",".","NB",":","raw","logits",",","not","after","log-softmax","labels",":","target","labels","act_lens",":","lengths","of","activations","label_lens",":","length","of","labels","sequences","Returns",":","batch","of","RNN-T","scores","(","loss",")"]
code: def forward(
      self,
      acts: torch.Tensor,
      labels: torch.Tensor,
      act_lens: torch.Tensor,
      label_lens: torch.Tensor,
  ) -> torch.Tensor:
      """
      Compute forward method for RNN-T.
  
      Args:
          acts: activations (joint tensor). NB: raw logits, not after log-softmax
          labels: target labels
          act_lens: lengths of activations
          label_lens: length of labels sequences
  
      Returns:
          batch of RNN-T scores (loss)
      """
      # argument names are consistent with NeMo, see RNNTLoss.forward:
      # self._loss(acts=log_probs, labels=targets, act_lens=input_lengths, label_lens=target_lengths)
      logits, targets, logits_lengths, target_lengths = (
          acts,
          labels,
          act_lens,
          label_lens,
      )
  
      # logits: B x Time x Text+1 x C
      vocab_size = logits.shape[-1]
      target_fsas_vec = self.get_graphs_batched(
          logits_lengths, targets, target_lengths, vocab_size
      )
  
      cast_context = (
          force_float32_context()
          if self.cast_to_float32
          else nullcontext()
      )
      with cast_context:
          log_probs = F.log_softmax(logits, dim=-1)
          with torch.no_grad():
              indices = self.get_logits_indices(
                  target_fsas_vec, logits.shape
              )
              # transition to the last state
              # use 0 index (for valid index_select) and manually assign score after index_select for this case
              indices[target_fsas_vec.labels == -1] = 0
  
          # NB: do not assign scores -> modify, k2 will not update all scores correctly (modify -> assign)
          scores = log_probs.flatten().index_select(-1, indices)
          # fix weights for the arcs to the last state
          scores[target_fsas_vec.labels == -1] = 0
  
          target_fsas_vec.scores = scores
          scores = -1 * target_fsas_vec.get_tot_scores(
              use_double_scores=self.double_scores, log_semiring=True
          )
          return scores
  
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 6 for calling the GraphRnntLoss obj's underlying member method code with example usage: obj.forward(acts, labels, act_lens, label_lens) and returns: scores