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 __init__(self, args, task):
      self.args = args
      self.task = task
      self.dummy_batch = None
  
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 1 to create a new BatchIterator object from inherited base classes: object with example: obj = BatchIterator(args, task)