class_docstr: Unit test for AsrSeqTask. 
code: def test_generate_data(self):
      for batch_mode in [True, False]:
          task_name = self.config["data"]["task"]["name"]
          self.config["data"]["task"]["batch_mode"] = batch_mode
          self.config["data"]["task"]["dummy"] = False
          task = registers.task[task_name](self.config, self.mode)
  
          with self.cached_session(use_gpu=False, force_gpu=False):
              for (
                  uttid,
                  feats,
                  src_lens,
                  targets,
                  tgt_lens,
              ) in task.generate_data():
                  logging.debug("uttid : {}".format(uttid))
                  logging.debug(
                      "feats : {}, shape : {}".format(
                          feats, feats.shape
                      )
                  )
                  logging.debug(
                      "targets : {}, shape : {}".format(
                          targets, targets.shape
                      )
                  )
                  logging.debug("src_len : {}".format(src_lens))
                  logging.debug("tgt_len : {}".format(tgt_lens))
                  self.assertDTypeEqual(feats, np.float32)
                  self.assertDTypeEqual(src_lens, np.int64)
                  self.assertDTypeEqual(targets, np.int64)
                  self.assertDTypeEqual(tgt_lens, np.int64)
  
                  if batch_mode:
                      self.assertEqual(len(uttid.shape), 1)
                      self.assertEqual(len(feats.shape), 3)
                      self.assertEqual(len(targets.shape), 2)
                      self.assertEqual(len(src_lens.shape), 1)
                      self.assertEqual(len(tgt_lens.shape), 1)
                  else:
                      self.assertEqual(tf.rank(uttid).numpy(), 0)
                      self.assertEqual(len(feats.shape), 2)
                      self.assertEqual(len(targets.shape), 1)
                      self.assertEqual(tf.rank(src_lens).numpy(), 0)
                      self.assertEqual(tf.rank(tgt_lens).numpy(), 0)
  
file_path: delta/delta/data/task/asr_seq_task_test.py
imports: from pathlib import Path
  from absl import logging
  import numpy
  import delta.compat
  from delta import utils
  from delta.data.utils.test_utils import generate_json_data
  from delta.utils.register import registers
  from delta.utils.register import import_all_modules_for_register
label_desc: Use image node_id 2 for calling the AsrSeqTaskTest obj's underlying member method code with example usage: obj.test_generate_data() without return types