class_docstr: A wrapper of fairseq data iterator, usage:
  batch_itr = BatchIterator(fairseq_args, fairseq_task)
  for epoch in batch_itr.train_epoch():
      for batch in batch_itr.train_batch():
          train(batch)
          if should_valid():
              for sub in batch_itr.valid_dataset():
                  for sample in batch_itr.valid_batch():
                      valid(sample)
                  pirnt(f"Finish valid {sub}")
      print(f"Finish train epoch {epoch}")
code: def _empty_batch(self, batch):
      # Fairseq dataloader may produce "DUMMY"
      if batch == "DUMMY":
          raise Exception(
              "Trying to use an uninitialized 'dummy' batch. This usually indicates "
              "that the total number of batches is smaller than the number of "
              "participating GPUs. Try reducing the batch size or using fewer GPUs."
          )
      return batch is None or len(batch) == 0
  
file_path: lightseq/examples/training/deepspeed/ds_fairseq_data.py
imports: import math
  import logging
  import torch.distributed
  from fairseq import utils
label_desc: Use image node_id 3 for calling the BatchIterator obj's underlying member method code with example usage: obj._empty_batch(batch) and returns: unknown