code: def _tests(dim, device):
      batch_size = 2 if dim == 3 else 10
      # - Cannot test linear against PIL, because PIL uses triangular filter when downscaling
      # - Cannot test Nearest Neighbor because rounding errors cause gross discrepancies (pixel shift)
      for mode in ["default", "stretch", "not_smaller", "not_larger"]:
          for (
              interp,
              dtype,
              channel_first,
              use_size_arg,
              use_size_input,
              w_input,
              h_input,
              d_input,
              use_roi,
          ) in [
              (
                  0,
                  types.UINT8,
                  True,
                  False,
                  False,
                  False,
                  False,
                  False,
                  False,
              ),
              (
                  1,
                  types.FLOAT,
                  False,
                  False,
                  False,
                  False,
                  True,
                  True,
                  True,
              ),
              (
                  0,
                  types.FLOAT,
                  True,
                  False,
                  False,
                  True,
                  True,
                  False,
                  True,
              ),
              (
                  1,
                  types.FLOAT,
                  False,
                  False,
                  False,
                  True,
                  False,
                  True,
                  False,
              ),
              (
                  0,
                  types.UINT8,
                  True,
                  True,
                  False,
                  False,
                  False,
                  False,
                  True,
              ),
              (
                  1,
                  types.UINT8,
                  False,
                  True,
                  True,
                  False,
                  False,
                  False,
                  False,
              ),
          ]:
              interp = [types.INTERP_TRIANGULAR, types.INTERP_LANCZOS3][
                  interp
              ]
              yield (
                  _test_ND,
                  device,
                  dim,
                  batch_size,
                  False,
                  mode,
                  interp,
                  dtype,
                  w_input,
                  h_input,
                  d_input,
                  use_size_arg,
                  use_size_input,
                  use_roi,
              )
  
imports: import cv2
  import functools
  import math
  import numpy
  import nvidia.dali
  import nvidia.dali.fn
  import nvidia.dali.types
  import os.path
  from nvidia.dali import Pipeline, pipeline_def
  from nvidia.dali.data_node import DataNode
  from test_utils import check_batch, get_dali_extra_path, as_array
  import PIL.Image
label_desc: Use image node_id 12 for calling a global function with example usage: _tests(dim, device) without return types