class_docstr: ctc utils unittest
class_docstr_tok: ["ctc","utils","unittest"]
docstr: unit test case for the transform_preprocess interface 
docstr_tok: ["unit","test","case","for","the","transform_preprocess","interface"]
code: def test_transform_preprocess(self):
      """unit test case for the transform_preprocess interface"""
      with self.cached_session():
          with self.assertRaises(ValueError) as valueErr:
              labels = ctc_utils.transform_preprocess(
                  labels=None, blank_index=None, num_class=None
              )
          the_exception = valueErr.exception
          self.assertEqual(
              str(the_exception),
              "blank_index must be greater than or equal to zero",
          )
  
          with self.assertRaises(ValueError) as valueErr:
              labels = ctc_utils.transform_preprocess(
                  labels=None, blank_index=-10, num_class=None
              )
          the_exception = valueErr.exception
          self.assertEqual(
              str(the_exception),
              "blank_index must be greater than or equal to zero",
          )
  
          with self.assertRaises(ValueError) as valueErr:
              labels = ctc_utils.transform_preprocess(
                  labels=None, blank_index=10, num_class=10
              )
          the_exception = valueErr.exception
          self.assertEqual(
              str(the_exception),
              "blank_index must be less than or equal to num_class - 1",
          )
  
          labels = ctc_utils.transform_preprocess(
              labels=None, blank_index=0, num_class=10
          )
          self.assertIsNone(labels)
  
          labels = ctc_utils.transform_preprocess(
              labels=tf.constant(self.labels),
              blank_index=0,
              num_class=10,
          )
          labels_values = np.asarray([1, 1, 1, 3, 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 3 for calling the CTCUtilTest obj's underlying member method code with example usage: obj.test_transform_preprocess() without return types