code: def test_case_small_blank_last(
      self, device, k2_is_appropriate, k2_cuda_is_enabled
  ):
      skip_test_if_unsupported(
          device, k2_is_appropriate, k2_cuda_is_enabled
      )
  
      acts = np.array(
          [
              [
                  [0.0, 1.0, 3.0],
                  [0.0, 2.0, 3.0],
                  [1.0, 1.0, 3.0],
                  [2.0, 3.0, 2.0],
                  [0.0, 0.0, 1.0],
                  [0.0, 1.0, 1.0],
                  [1.0, 0.0, 1.0],
                  [2.0, 2.0, 0.0],
                  [0.0, 2.0, 5.0],
                  [0.0, 3.0, 5.0],
                  [1.0, 2.0, 5.0],
                  [2.0, 4.0, 4.0],
                  [0.0, 3.0, 4.0],
                  [0.0, 4.0, 4.0],
                  [1.0, 3.0, 4.0],
                  [2.0, 5.0, 3.0],
                  [2.0, 2.0, 1.0],
                  [2.0, 3.0, 1.0],
                  [3.0, 2.0, 1.0],
                  [4.0, 4.0, 0.0],
              ]
          ]
      )
      labels = [[0, 1, 0, 0, 1, 0]]
  
      fn_k2 = init_k2_ctc(
          num_classes=acts.shape[-1],
          blank=acts.shape[-1] - 1,
          reduction="sum",
      )
      k2_cost, k2_grads = wrap_and_call(fn_k2, acts, labels, device)
  
      expected_cost = 6.823422
      expected_grads = np.array(
          [
              [
                  [-0.09792291, 0.11419516, -0.01627225],
                  [-0.08915664, 0.22963384, -0.14047718],
                  [-0.19687234, 0.06477807, 0.13209426],
                  [-0.22838503, 0.1980845, 0.03030053],
                  [-0.07985485, -0.0589368, 0.13879165],
                  [-0.04722299, 0.01424287, 0.03298012],
                  [0.01492161, 0.02710512, -0.04202673],
                  [-0.43219852, 0.4305843, 0.00161422],
                  [-0.00332598, 0.0440818, -0.04075582],
                  [-0.01329869, 0.11521607, -0.10191737],
                  [-0.03721291, 0.04389342, -0.00668051],
                  [-0.2723349, 0.43273386, -0.16039898],
                  [-0.03499417, 0.1896997, -0.15470551],
                  [-0.02911933, 0.29706067, -0.26794133],
                  [-0.04593367, -0.04479058, 0.09072424],
                  [-0.07227867, 0.16096972, -0.08869105],
                  [0.13993078, -0.20230117, 0.06237038],
                  [-0.05889719, 0.04007925, 0.01881794],
                  [-0.09667239, 0.07077749, 0.0258949],
                  [-0.49002117, 0.4954626, -0.00544143],
              ]
          ]
      )
  
      assert np.allclose(
          k2_cost, expected_cost, rtol=1e-6
      ), "small_test_blank_last costs mismatch."
      assert np.allclose(
          k2_grads, expected_grads, atol=1e-6
      ), "small_test_blank_last gradient mismatch."
  
file_path: NeMo/tests/collections/asr/k2/test_ctc.py
imports: import numpy
  import pytest
  import torch
  from torch.nn import CTCLoss
label_desc: Use image node_id 2 for calling the TestCTCLossK2 obj's underlying member method code with example usage: obj.test_case_small_blank_last(device, k2_is_appropriate, k2_cuda_is_enabled) without return types