code: def __init__(
      self,
      dataset,
      batch_size,
      pin_memory,
      local_rank,
      tput_timer,
      collate_fn=None,
      num_local_io_workers=None,
      data_sampler=None,
      data_parallel_world_size=None,
      data_parallel_rank=None,
      dataloader_drop_last=False,
      deepspeed_dataloader_config={},
  ):
      self.deepspeed_dataloader_config = deepspeed_dataloader_config
      self.tput_timer = tput_timer
      self.batch_size = batch_size
      self.curriculum_learning_enabled = False
      if CURRICULUM_LEARNING in deepspeed_dataloader_config:
          self.curriculum_learning_enabled = (
              deepspeed_dataloader_config[CURRICULUM_LEARNING]
          )
  
      if self.curriculum_learning_enabled:
          data_sampler = DeepSpeedDataSampler(
              self.deepspeed_dataloader_config[DATA_EFFICIENCY],
              len(dataset),
              self.batch_size,
              data_parallel_rank,
              data_parallel_world_size,
              self.deepspeed_dataloader_config[DATA_PARALLEL_GROUP],
              self.deepspeed_dataloader_config[
                  GRADIENT_ACCUMULATION_STEPS
              ],
              self.deepspeed_dataloader_config[GLOBAL_RANK],
              drop_last=dataloader_drop_last,
          )
          device_count = get_accelerator().device_count()
          num_local_io_workers = self.deepspeed_dataloader_config[
              DATA_SAMPLING_NUM_WORKERS
          ]
      else:
          if local_rank >= 0:
              if data_sampler is None:
                  data_sampler = DistributedSampler(
                      dataset=dataset,
                      num_replicas=data_parallel_world_size,
                      rank=data_parallel_rank,
                  )
              device_count = 1
          else:
              if data_sampler is None:
                  data_sampler = RandomSampler(dataset)
              device_count = get_accelerator().device_count()
              batch_size *= device_count
  
          if num_local_io_workers is None:
              num_local_io_workers = 2 * device_count
  
      self.num_local_io_workers = num_local_io_workers
      self.data_sampler = data_sampler
      self.dataset = dataset
      self.collate_fn = collate_fn
      self.device_count = device_count
      self.batch_size = batch_size
      self.pin_memory = pin_memory
      self.data = None
      self.dataloader_drop_last = dataloader_drop_last
      self.post_process_func = None
  
      if self.dataloader_drop_last:
          self.len = len(self.data_sampler) // self.batch_size
      else:
          from math import ceil
  
          self.len = ceil(len(self.data_sampler) / self.batch_size)
  
file_path: DeepSpeed/deepspeed/runtime/dataloader.py
imports: from torch.utils.data import DataLoader, RandomSampler
  from torch.utils.data.distributed import DistributedSampler
  from deepspeed.accelerator import get_accelerator
  from deepspeed.runtime.data_pipeline.data_sampling.data_sampler import DeepSpeedDataSampler
  from deepspeed.runtime.data_pipeline.constants import CURRICULUM_LEARNING, DATA_EFFICIENCY, DATA_SAMPLING_NUM_WORKERS
  from deepspeed.runtime.constants import GRADIENT_ACCUMULATION_STEPS, DATA_PARALLEL_GROUP, GLOBAL_RANK
label_desc: Use image node_id 1 to create a new DeepSpeedDataLoader object from inherited base classes: object with example: obj = DeepSpeedDataLoader(dataset, batch_size, pin_memory, local_rank, tput_timer, collate_fn, num_local_io_workers, data_sampler, data_parallel_world_size, data_parallel_rank, dataloader_drop_last, deepspeed_dataloader_config)