class_docstr: ctc utils unittest
class_docstr_tok: ["ctc","utils","unittest"]
docstr: unit test case for the labels_blankid_to_last interface 
docstr_tok: ["unit","test","case","for","the","labels_blankid_to_last","interface"]
code: def test_labels_blankid_to_last(self):
      """unit test case for the labels_blankid_to_last interface"""
      with self.cached_session():
          with self.assertRaises(AssertionError) as assert_err:
              labels = ctc_utils.labels_blankid_to_last(
                  labels=self.labels, blank_index=0, num_class=None
              )
          the_exception = assert_err.exception
          self.assertEqual(
              str(the_exception), "The num_class should not be None!"
          )
  
          labels = ctc_utils.labels_blankid_to_last(
              labels=tf.constant(self.labels),
              blank_index=0,
              num_class=6,
          )
          labels_values = np.asarray([0, 0, 0, 2, 0, 0, 0])
          labels_index = np.asarray(
              [[0, 0], [0, 1], [0, 2], [0, 3], [1, 0], [1, 1], [1, 2]]
          )
          labels_shape = np.asarray([2, 4])
          self.assertAllEqual(labels.eval().values, labels_values)
          self.assertAllEqual(labels.eval().indices, labels_index)
          self.assertAllEqual(labels.eval().dense_shape, labels_shape)
  
          labels = ctc_utils.labels_blankid_to_last(
              labels=tf.constant(self.labels),
              blank_index=2,
              num_class=6,
          )
          labels_values = np.asarray([1, 1, 1, 2, 1, 1, 1])
          labels_index = np.asarray(
              [[0, 0], [0, 1], [0, 2], [0, 3], [1, 0], [1, 1], [1, 2]]
          )
          labels_shape = np.asarray([2, 4])
          self.assertAllEqual(labels.eval().values, labels_values)
          self.assertAllEqual(labels.eval().indices, labels_index)
          self.assertAllEqual(labels.eval().dense_shape, labels_shape)
  
file_path: delta/delta/utils/ctc_utils_test.py
imports: import numpy
  import delta.compat
  from delta.utils import ctc_utils
label_desc: Use image node_id 5 for calling the CTCUtilTest obj's underlying member method code with example usage: obj.test_labels_blankid_to_last() without return types