code: def test_resize_upsample_scales_nearest(device):
      data = data_1x1x2x2
      scales = np.array([1.0, 1.0, 2.0, 3.0], dtype=np.float32)
  
      # from onnx.backend.test.case.node.resize import interpolate_nd, nearest_coeffs
      # expected = interpolate_nd(data, lambda x, _: nearest_coeffs(x), scale_factors=scales)
      expected = np.array(
          [
              [
                  [
                      [1.0, 1.0, 1.0, 2.0, 2.0, 2.0],
                      [1.0, 1.0, 1.0, 2.0, 2.0, 2.0],
                      [3.0, 3.0, 3.0, 4.0, 4.0, 4.0],
                      [3.0, 3.0, 3.0, 4.0, 4.0, 4.0],
                  ]
              ]
          ],
          dtype=np.float32,
      )
  
      def resize_fn(input_data):
          return fn.experimental.tensor_resize(
              input_data,
              scales=scales,
              alignment=0,
              interp_type=types.INTERP_NN,
          )
  
      run_and_compare(expected, data, device, resize_fn)
  
file_path: DALI/dali/test/python/operator_2/test_tensor_resize.py
imports: import nvidia.dali.types
  from nvidia.dali import pipeline_def, fn
  from nose2.tools import params
  import numpy
  from test_utils import as_array
label_desc: Use image node_id 2 for calling a global function with example usage: test_resize_upsample_scales_nearest(device) and returns: fn