code: def prepare_dataloader(
      dataset, current_gpu_index, num_gpus, batch_size
  ):
      sampler = torch.utils.data.distributed.DistributedSampler(
          dataset,
          num_replicas=num_gpus,
          rank=current_gpu_index,
          shuffle=False,
      )
      dataloader = torch.utils.data.DataLoader(
          dataset,
          sampler=sampler,
          batch_size=batch_size,
          shuffle=False,
      )
      return dataloader
  
file_path: keras/guides/distributed_training_with_torch.py
imports: import os
  import torch
  import numpy
  import keras
label_desc: Use image node_id 6 for calling a global function with example usage: prepare_dataloader(dataset, current_gpu_index, num_gpus, batch_size) and returns: dataloader