code: def get_dataloaders(
      datasets_info,
      benchmark_config,
      model_specs,
      num_replicas=1,
      rank=0,
  ):
      (
          ntokens,
          train_dataset,
          valid_dataset,
          test_dataset,
      ) = datasets_info
  
      def batchify(data):
          batch_size = benchmark_config["batch_size"]
          return _batchify(data, batch_size)
  
      total_batch_size = _get_total_batch_size(
          benchmark_config, model_specs
      )
      train_dataloader = DataLoader(
          train_dataset,
          sampler=DistributedSampler(
              train_dataset, num_replicas=num_replicas, rank=rank
          ),
          batch_size=total_batch_size,
          collate_fn=batchify,
      )
      valid_dataloader = DataLoader(
          valid_dataset,
          sampler=DistributedSampler(
              valid_dataset, num_replicas=num_replicas, rank=rank
          ),
          batch_size=total_batch_size,
          collate_fn=batchify,
      )
      test_dataloader = DataLoader(
          test_dataset,
          sampler=DistributedSampler(
              test_dataset, num_replicas=num_replicas, rank=rank
          ),
          batch_size=total_batch_size,
          collate_fn=batchify,
      )
      return train_dataloader, valid_dataloader, test_dataloader
  
file_path: fairscale/benchmarks/datasets/wikitext2_data.py
imports: from collections import namedtuple
  from distutils.version import LooseVersion
  import io
  import operator
  import tempfile
  import torch
  from torch.utils.data import DataLoader
  from torch.utils.data.distributed import DistributedSampler
  import torchtext
  from torchtext.data.utils import get_tokenizer
  from torchtext.utils import download_from_url, extract_archive
label_desc: Use image node_id 4 for calling a global function with example usage: get_dataloaders(datasets_info, benchmark_config, model_specs, num_replicas, rank) and returns: train_dataloader,  valid_dataloader,  test_dataloader, _batchify