code: def make_onnx_model(
      x_shape,
      roi,
      scales,
      sizes,
      mode,
      coord_mode,
      cubic_coeff_a,
      exclude_outside,
      extrapolation_value,
      nearest_mode,
  ):
      import onnx.helper as oh
      from onnx import TensorProto
  
      # Resize node
      sizes_name = "sizes" if len(sizes) > 0 else ""
      node = oh.make_node(
          "Resize",
          inputs=["X", "roi", "scales", sizes_name],
          outputs=["Y"],
          coordinate_transformation_mode=coord_mode,
          cubic_coeff_a=cubic_coeff_a,
          exclude_outside=exclude_outside,
          extrapolation_value=extrapolation_value,
          mode=mode,
          nearest_mode=nearest_mode,
      )
  
      inputs = []
  
      # X value_info
      x_value = oh.make_tensor_value_info(
          "X", TensorProto.FLOAT, x_shape
      )
      inputs.append(x_value)
  
      # roi value_info
      if len(roi) > 0:
          roi_value = oh.make_tensor_value_info(
              "roi", TensorProto.FLOAT, roi.shape
          )
      else:
          roi_value = oh.make_tensor_value_info(
              "roi", TensorProto.FLOAT, []
          )
      inputs.append(roi_value)
  
      # scales value_info
      x_dims = len(x_shape)
      y_shape = None
      if len(scales) > 0:
          assert len(scales) == x_dims
          y_shape = [int(x * scales[i]) for i, x in enumerate(x_shape)]
          scales_value = oh.make_tensor_value_info(
              "scales", TensorProto.FLOAT, scales.shape
          )
      else:
          scales_value = oh.make_tensor_value_info(
              "scales", TensorProto.FLOAT, []
          )
      inputs.append(scales_value)
  
      # sizes value_info
      if len(sizes) > 0:
          assert len(sizes) == x_dims
          y_shape = [int(x) for x in sizes]
          sizes_value = oh.make_tensor_value_info(
              "sizes", TensorProto.INT64, sizes.shape
          )
      else:
          sizes_value = oh.make_tensor_value_info(
              "sizes", TensorProto.INT64, []
          )
      inputs.append(sizes_value)
  
      # Y value_info
      outputs = [
          oh.make_tensor_value_info("Y", TensorProto.FLOAT, y_shape)
      ]
  
      # Model
      opset = onnx.OperatorSetIdProto()
      opset.version = 11
      graph = oh.make_graph([node], "onnx_resize_test", inputs, outputs)
      model = oh.make_model(graph, opset_imports=[opset])
      onnx.checker.check_model(model)
      return model
  
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 1 for calling a global function with example usage: make_onnx_model(x_shape, roi, scales, sizes, mode, coord_mode, cubic_coeff_a, exclude_outside, extrapolation_value, nearest_mode) and returns: model