code: def ref_resize_onnx_ref(
      x,
      roi,
      scales,
      sizes,
      mode,
      coord_mode,
      cubic_coeff_a,
      exclude_outside,
      extrapolation_value,
      nearest_mode,
  ):
      def get_coeffs(x):
          if mode == "nearest":
              return nearest_coeffs(x, mode=nearest_mode)
          if mode == "linear":
              return linear_coeffs(x)
          if mode == "cubic":
              return cubic_coeffs(x, A=cubic_coeff_a)
  
      roi = None if len(roi) == 0 else roi
      if len(scales) > 0:
          output = interpolate_nd(
              x,
              get_coeffs,
              scale_factors=scales,
              roi=roi,
              coordinate_transformation_mode=coord_mode,
              exclude_outside=exclude_outside,
              extrapolation_value=extrapolation_value,
          )
      elif len(sizes) > 0:
          output = interpolate_nd(
              x,
              get_coeffs,
              output_size=sizes,
              roi=roi,
              coordinate_transformation_mode=coord_mode,
              exclude_outside=exclude_outside,
              extrapolation_value=extrapolation_value,
          )
      return output
  
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 2 for calling a global function with example usage: ref_resize_onnx_ref(x, roi, scales, sizes, mode, coord_mode, cubic_coeff_a, exclude_outside, extrapolation_value, nearest_mode) and returns: output, nearest_coeffs, linear_coeffs, cubic_coeffs