code: def create_input_tensor(batch_size, file_list):
      """
      Creates an input batch to the DALI Pipeline.
      The batch will comprise the files defined within file list and will be shuffled.
      If the file list contains fewer files than the batch size, they will be repeated.
      The encoded images will be padded.
      :param batch_size: Requested batch size.
      :param file_list: List of images to be loaded.
      :return:
      """
      # Adjust file_list to batch_size
      while len(file_list) < batch_size:
          file_list += file_list
      file_list = file_list[:batch_size]
  
      random.shuffle(file_list)
  
      # Read the files as byte buffers
      arrays = list(
          map(lambda x: np.fromfile(x, dtype=np.uint8), file_list)
      )
  
      # Pad the encoded images
      lengths = list(
          map(
              lambda x, ar=arrays: ar[x].shape[0],
              [x for x in range(len(arrays))],
          )
      )
      max_len = max(lengths)
      arrays = list(
          map(
              lambda ar, ml=max_len: np.pad(ar, (0, ml - ar.shape[0])),
              arrays,
          )
      )
  
      for arr in arrays:
          assert (
              arr.shape == arrays[0].shape
          ), "Arrays must have the same shape"
      return np.stack(arrays)
  
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 5 for calling a global function with example usage: create_input_tensor(batch_size, file_list) and returns: np