code: def vit_pipeline(
      is_training=False, image_shape=(384, 384, 3), num_classes=1000
  ):
      files_paths = [
          os.path.join(args.images_dir, f)
          for f in os.listdir(args.images_dir)
      ]
  
      img, clss = fn.readers.webdataset(
          paths=files_paths,
          index_paths=None,
          ext=["jpg", "cls"],
          missing_component_behavior="error",
          random_shuffle=False,
          shard_id=0,
          num_shards=1,
          pad_last_batch=False if is_training else True,
          name="webdataset_reader",
      )
  
      use_gpu = args.device == "gpu"
      labels = fn.python_function(
          clss, function=non_image_preprocessing, num_outputs=1
      )
      if use_gpu:
          labels = labels.gpu()
      labels = fn.one_hot(labels, num_classes=num_classes)
  
      device = "mixed" if use_gpu else "cpu"
      img = fn.decoders.image(
          img,
          device=device,
          output_type=types.RGB,
          hw_decoder_load=args.hw_load,
          preallocate_width_hint=args.width_hint,
          preallocate_height_hint=args.height_hint,
      )
  
      if is_training:
          img = fn.random_resized_crop(img, size=image_shape[:-1])
          img = fn.flip(
              img, depthwise=0, horizontal=fn.random.coin_flip()
          )
  
          # color jitter
          brightness = fn.random.uniform(range=[0.6, 1.4])
          contrast = fn.random.uniform(range=[0.6, 1.4])
          saturation = fn.random.uniform(range=[0.6, 1.4])
          hue = fn.random.uniform(range=[0.9, 1.1])
          img = fn.color_twist(
              img,
              brightness=brightness,
              contrast=contrast,
              hue=hue,
              saturation=saturation,
          )
  
          # auto-augment
          # `shape` controls the magnitude of the translation operations
          img = auto_augment.auto_augment_image_net(img)
      else:
          img = fn.resize(img, size=image_shape[:-1])
  
      # normalize
      # https://github.com/NVIDIA/DALI/issues/4469
      mean = np.asarray([0.485, 0.456, 0.406])[None, None, :]
      std = np.asarray([0.229, 0.224, 0.225])[None, None, :]
      scale = 1 / 255.0
      img = fn.normalize(
          img,
          mean=mean / scale,
          stddev=std,
          scale=scale,
          dtype=types.FLOAT,
      )
  
      return img, labels
  
file_path: DALI/tools/hw_decoder_bench.py
imports: import argparse
  import nvidia.dali.fn
  import nvidia.dali.types
  import time
  from nvidia.dali.pipeline import pipeline_def
  import random
  import numpy
  import os
  from nvidia.dali.auto_aug import auto_augment
label_desc: Use image node_id 7 for calling a global function with example usage: vit_pipeline(is_training, image_shape, num_classes) and returns: img,  labels