code: def test_upsample(self):
      X = np.random.randn(1, 1, 2, 2).astype(np.float32)
      width_scale = 2.0
      height_scale = 2.0
  
      predict_net = caffe2_pb2.NetDef()
      predict_net.name = "test-upsample-net"
      predict_net.external_input[:] = ["X"]
      predict_net.external_output[:] = ["Y"]
      predict_net.op.extend(
          [
              core.CreateOperator(
                  "ResizeNearest",
                  inputs=["X"],
                  outputs=["Y"],
                  width_scale=width_scale,
                  height_scale=height_scale,
              ),
          ]
      )
      ws, c2_outputs = c2_native_run_net(
          init_net=None, predict_net=predict_net, inputs=[X]
      )
  
      onnx_model = c2_onnx.caffe2_net_to_onnx_model(
          predict_net=predict_net,
          value_info={
              "X": (
                  onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[X.dtype],
                  X.shape,
              )
          },
      )
      onnx_outputs = c2.run_model(onnx_model, inputs=[X])
      self.assertSameOutputs(c2_outputs, onnx_outputs)
  
imports: import os
  import unittest
  from caffe2.python import core
  from caffe2.proto import caffe2_pb2
  import onnx
  from onnx.helper import make_node, make_graph, make_tensor, make_tensor_value_info, make_model
  from caffe2.python.onnx.helper import c2_native_run_net, c2_native_run_op
  from onnx import mapping
  import caffe2.python.onnx.frontend
  import caffe2.python.onnx.backend
  import numpy
  from caffe2.python.models.download import ModelDownloader
  from caffe2.python.onnx.tests.test_utils import TestCase
  import caffe2.python._import_c_extension
label_desc: Use image node_id 9 for calling the TestCaffe2Basic obj's underlying member method code with example usage: obj.test_upsample() without return types