code: def test_onnx_resize_forward(
      seed,
      x_shape,
      roi,
      scales,
      sizes,
      mode,
      coord_mode,
      cubic_coeff_a,
      exclude_outside,
      extrapolation_value,
      nearest_mode,
      ctx,
      func_name,
  ):
      pytest.skip("This test needs onnx, test locally.")
  
      import onnx
      import onnxruntime as ort
      from onnx.backend.test.case.node.resize import (
          interpolate_nd,
          nearest_coeffs,
          linear_coeffs,
          cubic_coeffs,
      )
  
      # Compute the number of resize dimension
      if len(scales) > 0:
          num_outer_dims = next(
              (i for i, s in enumerate(scales) if s != 1.0), 0
          )
      if len(sizes) > 0:
          num_outer_dims = 0
          for i, (isize, osize) in enumerate(zip(x_shape, sizes)):
              if isize != osize:
                  break
              num_outer_dims += 1
      num_resize_dims = len(x_shape) - num_outer_dims
  
      # Check ONNX Runtime limitation
      cubic_not_2d = mode == "cubic" and num_resize_dims != 2
      if cubic_not_2d and not USE_ONNX_REF:
          pytest.skip(
              "ONNX Runtime only supports "
              + "2D interpolation when mode is 'cubic'"
          )
      use_onnx_ref = (cubic_not_2d and USE_ONNX_REF) or FORCE_ONNX_REF
  
      if use_onnx_ref and coord_mode == "tf_half_pixel_for_nn":
          pytest.skip(
              "ONNX reference implementation does not support "
              + "tf_half_pixel_for_nn"
          )
  
      # Slice 3D roi to target dimensions
      roi_dims = len(roi) // 2
      ndim = len(x_shape)
      roi_sta = [0.0] * num_outer_dims
      roi_end = [1.0] * num_outer_dims
      roi_sta += roi[0 * roi_dims + 0 : 0 * roi_dims + num_resize_dims]
      roi_end += roi[1 * roi_dims + 0 : 1 * roi_dims + num_resize_dims]
      roi = roi_sta + roi_end
  
      # Prepare inputs
      rng = np.random.RandomState(seed)
      x = rng.rand(*x_shape).astype(np.float32)
      roi = np.array(roi, dtype=np.float32)
      scales = np.array(scales, dtype=np.float32)
      sizes = np.array(sizes, dtype=np.int64)
  
      # Run nnabla function
      vx = nn.Variable.from_numpy_array(x)
      with nn.context_scope(ctx), nn.auto_forward():
          vy = F.onnx_resize(
              vx,
              roi,
              scales,
              sizes,
              mode,
              coord_mode,
              cubic_coeff_a,
              exclude_outside,
              extrapolation_value,
              nearest_mode,
          )
  
      # Run reference
      if use_onnx_ref:
          ref = ref_resize_onnx_ref(
              x,
              roi,
              scales,
              sizes,
              mode,
              coord_mode,
              cubic_coeff_a,
              exclude_outside,
              extrapolation_value,
              nearest_mode,
          )
      else:
          ref = ref_resize_ort(
              x,
              roi,
              scales,
              sizes,
              mode,
              coord_mode,
              cubic_coeff_a,
              exclude_outside,
              extrapolation_value,
              nearest_mode,
          )
  
      # Check results
      assert_allclose(vy.d, ref)
      assert func_name == vy.parent.name
  
file_path: nnabla/python/test/function/test_onnx_resize.py
imports: import pytest
  import numpy
  import nnabla
  import nnabla.functions
  from nbla_test_utils import list_context
  from nnabla.testing import assert_allclose
label_desc: Use image node_id 4 for calling a global function with example usage: test_onnx_resize_forward(seed, x_shape, roi, scales, sizes, mode, coord_mode, cubic_coeff_a, exclude_outside, extrapolation_value, nearest_mode, ctx, func_name) without return types