code: def _test_resize(layout, interp, dtype, w, h):
      channel_first = layout == "FCHW"
      pipe_dali = create_dali_pipe(
          channel_first, 8, interp, dtype, w, h
      )
      pipe_dali.build()
      pipe_ref = create_ref_pipe(channel_first, 8, interp, dtype, w, h)
      pipe_ref.build()
      eps = 1e-2
      max_err = 6
      for iter in range(4):
          out_dali = pipe_dali.run()
          out_ref = pipe_ref.run()[0]
          dali_cpu = out_dali[0]
          dali_gpu = out_dali[1]
          if interp == types.INTERP_LANCZOS3:
              # PIL can't resize float data. Lanczos resampling generates overshoot which we have
              # to get rid of for the comparison to succeed.
              dali_cpu = [np.array(x).clip(0, 255) for x in dali_cpu]
              dali_gpu = [
                  np.array(x).clip(0, 255) for x in dali_gpu.as_cpu()
              ]
          else:
              dali_cpu = [np.array(x) for x in dali_cpu]
              dali_gpu = [np.array(x) for x in dali_gpu.as_cpu()]
          if channel_first:
              out_ref = [np.array(x)[:, :, 1:-1, 1:-1] for x in out_ref]
              dali_gpu = [x[:, :, 1:-1, 1:-1] for x in dali_gpu]
              dali_cpu = [x[:, :, 1:-1, 1:-1] for x in dali_cpu]
          else:
              out_ref = [np.array(x)[:, 1:-1, 1:-1, :] for x in out_ref]
              dali_gpu = [x[:, 1:-1, 1:-1, :] for x in dali_gpu]
              dali_cpu = [x[:, 1:-1, 1:-1, :] for x in dali_cpu]
          check_batch(
              dali_cpu, out_ref, 2, eps=eps, max_allowed_error=max_err
          )
          check_batch(
              dali_gpu, out_ref, 2, eps=eps, max_allowed_error=max_err
          )
          ext_size = out_dali[2]
          size_cpu = out_dali[3]
          size_gpu = out_dali[4]
          check_batch(ext_size, size_cpu, 2)
          check_batch(ext_size, size_gpu, 2)
  
file_path: DALI/dali/test/python/operator_2/test_resize_seq.py
imports: import nvidia.dali
  import nvidia.dali.fn
  import nvidia.dali.types
  import numpy
  import os.path
  from test_utils import check_batch
  import PIL.Image
label_desc: Use image node_id 6 for calling a global function with example usage: _test_resize(layout, interp, dtype, w, h) without return types