code: def test_small_random_grid_compose_equivalent(
      self,
      device: torch.device,
      blank_first: bool,
      rnn_loss_sample_data,
  ):
      sample_data = rnn_loss_sample_data.get_sample_small_random(
          blank_first, device=device
      )
      criterion = GraphRnntLoss(
          blank=sample_data.blank_id,
          connect_composed=True,
          use_grid_implementation=False,
      )
      text_tensor = sample_data.targets[0]
      num_frames = sample_data.logits.shape[1]
      graph_grid = criterion.get_grid(
          text_tensor, num_frames, sample_data.vocab_size
      )
      graph_composed = criterion.get_composed_lattice(
          text_tensor, num_frames, sample_data.vocab_size
      )
      assert k2.is_rand_equivalent(
          graph_grid,
          graph_composed,
          log_semiring=True,
          treat_epsilons_specially=False,
      ), "Grid and composed graphs are not equivalent."
  
file_path: NeMo/tests/collections/asr/k2/test_graph_transducer.py
imports: from typing import List
  import numpy
  import pytest
  import torch
  from nemo.collections.asr.parts.numba.rnnt_loss.rnnt_numpy import RNNTLoss
label_desc: Use image node_id 8 for calling the TestGraphRnnt obj's underlying member method code with example usage: obj.test_small_random_grid_compose_equivalent(device, blank_first, rnn_loss_sample_data) without return types