code: def build_dataloader(args, mode):
      """
      Build a dataloader to process datasets. Only DALI dataloader is supported now.
      Args:
          args(Namespace): Arguments obtained from ArgumentParser.
          mode(utils.Mode): Train or eval mode.
  
      Returns:
          dataloader(nvidia.dali.plugin.paddle.DALIGenericIterator):
              Iteratable outputs of DALI pipeline,
              including "data" and "label" in type of Paddle's Tensor.
      """
      assert (
          mode in Mode
      ), "Dataset mode should be in supported Modes (train or eval)"
      return dali_dataloader(args, mode, paddle.device.get_device())
  
file_path: DALI/docs/examples/use_cases/paddle/resnet50/dali.py
imports: import ctypes
  import os
  from dataclasses import dataclass
  import paddle
  import numpy
  from nvidia.dali.backend import TensorListCPU
  import nvidia.dali.fn
  import nvidia.dali.types
  from nvidia.dali.pipeline import pipeline_def
  from nvidia.dali.plugin.paddle import DALIGenericIterator
  from utils.mode import Mode
  from utils.utility import get_num_trainers, get_trainer_id
label_desc: Use image node_id 3 for calling a global function with example usage: build_dataloader(args, mode) and returns: dali_dataloader