code: def get_dali_val_loader():
      def gdvl(
          data_path,
          image_size,
          batch_size,
          num_classes,
          one_hot,
          interpolation="bilinear",
          crop_padding=32,
          workers=5,
          _worker_init_fn=None,
          memory_format=torch.contiguous_format,
          **kwargs,
      ):
          if torch.distributed.is_initialized():
              rank = torch.distributed.get_rank()
              world_size = torch.distributed.get_world_size()
          else:
              rank = 0
              world_size = 1
  
          interpolation = {
              "bicubic": types.INTERP_CUBIC,
              "bilinear": types.INTERP_LINEAR,
              "triangular": types.INTERP_TRIANGULAR,
          }[interpolation]
  
          output_layout = (
              "HWC" if memory_format == torch.channels_last else "CHW"
          )
  
          valdir = os.path.join(data_path, "val")
  
          pipeline_kwargs = {
              "batch_size": batch_size,
              "num_threads": workers,
              "device_id": rank % torch.cuda.device_count(),
              "seed": 12 + rank % torch.cuda.device_count(),
          }
  
          pipe = validation_pipe(
              data_dir=valdir,
              interpolation=interpolation,
              image_size=image_size + crop_padding,
              image_crop=image_size,
              output_layout=output_layout,
              **pipeline_kwargs,
          )
  
          pipe.build()
          val_loader = DALIClassificationIterator(
              pipe, reader_name="Reader", fill_last_batch=False
          )
  
          return (
              DALIWrapper(
                  val_loader, num_classes, one_hot, memory_format
              ),
              int(
                  pipe.epoch_size("Reader") / (world_size * batch_size)
              ),
          )
  
      return gdvl
  
imports: import os
  import torch
  import numpy
  from PIL import Image
  from functools import partial
  from image_classification.autoaugment import AutoaugmentImageNetPolicy
  import torchvision.datasets
  import torchvision.transforms
label_desc: Use image node_id 3 for calling a global function with example usage: get_dali_val_loader() and returns: gdvl, DALIWrapper,  int