code: def test_resize_upsample_scales_cubic(device):
      data = data_1x1x4x4
      scales = np.array([1.0, 1.0, 2.0, 2.0], dtype=np.float32)
  
      # from onnx.backend.test.case.node.resize import interpolate_nd, cubic_coeffs
      # expected = interpolate_nd(data, lambda x, _: cubic_coeffs(x, A=-0.5), scale_factors=scales)
      expected = np.array(
          [
              [
                  [
                      [
                          0.6484375,
                          0.8984375,
                          1.4453125,
                          1.96875,
                          2.46875,
                          2.9921875,
                          3.5390625,
                          3.7890625,
                      ],
                      [
                          1.6484375,
                          1.8984375,
                          2.4453125,
                          2.96875,
                          3.46875,
                          3.9921875,
                          4.5390625,
                          4.7890625,
                      ],
                      [
                          3.8359375,
                          4.0859375,
                          4.6328125,
                          5.15625,
                          5.65625,
                          6.1796875,
                          6.7265625,
                          6.9765625,
                      ],
                      [
                          5.9296875,
                          6.1796875,
                          6.7265625,
                          7.25,
                          7.75,
                          8.2734375,
                          8.8203125,
                          9.0703125,
                      ],
                      [
                          7.9296875,
                          8.1796875,
                          8.7265625,
                          9.25,
                          9.75,
                          10.2734375,
                          10.8203125,
                          11.0703125,
                      ],
                      [
                          10.0234375,
                          10.2734375,
                          10.8203125,
                          11.34375,
                          11.84375,
                          12.3671875,
                          12.9140625,
                          13.1640625,
                      ],
                      [
                          12.2109375,
                          12.4609375,
                          13.0078125,
                          13.53125,
                          14.03125,
                          14.5546875,
                          15.1015625,
                          15.3515625,
                      ],
                      [
                          13.2109375,
                          13.4609375,
                          14.0078125,
                          14.53125,
                          15.03125,
                          15.5546875,
                          16.1015625,
                          16.3515625,
                      ],
                  ]
              ]
          ],
          dtype=np.float32,
      )
  
      def resize_fn(input_data):
          return fn.experimental.tensor_resize(
              input_data,
              scales=scales,
              alignment=0,
              interp_type=types.INTERP_CUBIC,
              antialias=False,
          )
  
      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 8 for calling a global function with example usage: test_resize_upsample_scales_cubic(device) and returns: fn