code: def test_small_compose_transducer(
      self,
      device,
      connect_composed,
      blank_first,
      rnnt_test_helper,
      rnn_loss_sample_data,
  ):
      if blank_first:
          sample_data = rnn_loss_sample_data.get_sample_small()
      else:
          sample_data = (
              rnn_loss_sample_data.get_sample_small_blank_last()
          )
      graph_rnnt = GraphRnntLoss(
          blank=sample_data.blank_id,
          connect_composed=connect_composed,
          use_grid_implementation=False,
      )
      graph_cost, graph_grads = rnnt_test_helper.wrap_and_call(
          graph_rnnt, sample_data.logits, sample_data.targets, device
      )
      assert np.allclose(
          graph_cost,
          sample_data.expected_cost.numpy(),
          rtol=EPS_SM_INPUT,
      ), "costs mismatch."
      assert np.allclose(
          graph_grads, sample_data.expected_grads.numpy(), atol=1e-6
      ), "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 4 for calling the TestGraphRnnt obj's underlying member method code with example usage: obj.test_small_compose_transducer(device, connect_composed, blank_first, rnnt_test_helper, rnn_loss_sample_data) without return types