code: def run_decode(data_path, out_type):
      batch_size = 4
      pipe = Pipeline(batch_size=batch_size, num_threads=4, device_id=0)
      input, _ = fn.readers.file(
          file_root=data_path, shard_id=0, num_shards=1, name="reader"
      )
      decoded = fn.decoders.image(input, output_type=types.RGB)
      decoded_shape = fn.shapes(decoded)
      raw_shape = fn.peek_image_shape(input, dtype=out_type)
      pipe.set_outputs(decoded, decoded_shape, raw_shape)
      pipe.build()
      samples = 0
      length = pipe.reader_meta(name="reader")["epoch_size"]
      while samples < length:
          samples += batch_size
          (images, decoded_shape, raw_shape) = pipe.run()
          for i in range(batch_size):
              # as we are asking for a particular color space it may
              # differ from the source image, so don't compare it
              image = images.at(i)
              shape_type = (
                  np.int64
                  if out_type is None
                  else dali_type_to_np(out_type)
              )
              for d in range(len(image.shape) - 1):
                  assert (
                      image.shape[d] == decoded_shape.at(i)[d]
                  ), "{} vs {}".format(
                      image.shape[d], decoded_shape.at(i)[d]
                  )
                  assert (
                      image.shape[d] == raw_shape.at(i)[d]
                  ), "{} vs {}".format(
                      image.shape[d], raw_shape.at(i)[d]
                  )
                  assert (
                      raw_shape.at(i)[d].dtype == shape_type
                  ), "{} vs {}".format(
                      raw_shape.at(i)[d].dtyp, shape_type
                  )
  
imports: import numpy
  import nvidia.dali.fn
  from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.types
  import os
  from test_utils import get_dali_extra_path, dali_type_to_np
label_desc: Use image node_id 1 for calling a global function with example usage: run_decode(data_path, out_type) without return types