code: def test_medium_random_var_size(
      self, device, rnnt_test_helper, rnn_loss_sample_data
  ):
      sample_data = (
          rnn_loss_sample_data.get_sample_medium_random_var_size(
              blank_first=True
          )
      )
      graph_rnnt = GraphRnntLoss(blank=0, use_grid_implementation=True)
      graph_cost, graph_grads = rnnt_test_helper.wrap_and_call(
          graph_rnnt,
          sample_data.logits.detach(),
          sample_data.targets,
          device,
          input_lengths=sample_data.input_lengths,
          target_lengths=sample_data.target_lengths,
      )
      etalon_rnnt = RNNTLoss_Numpy(blank=0)
      etalon_cost, etalon_grads = rnnt_test_helper.wrap_and_call(
          etalon_rnnt,
          sample_data.logits.detach(),
          sample_data.targets,
          device,
          input_lengths=sample_data.input_lengths,
          target_lengths=sample_data.target_lengths,
      )
      assert np.allclose(
          graph_cost.sum(), etalon_cost, rtol=EPS_SM_INPUT
      ), "costs mismatch."
      assert np.allclose(
          graph_grads, etalon_grads, atol=1e-4
      ), "gradient mismatch."
  
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 7 for calling the TestGraphRnnt obj's underlying member method code with example usage: obj.test_medium_random_var_size(device, rnnt_test_helper, rnn_loss_sample_data) without return types