code: def _test_net(
      self, net_name, input_blob_dims=(1, 3, 224, 224), decimal=7
  ):
      np.random.seed(seed=0)
      try:
          (
              c2_init_net,
              c2_predict_net,
              value_info,
              debug_str,
          ) = self.model_downloader.get_c2_model_dbg(net_name)
      except Exception as e:
          # catch IOError/OSError that is caused by FileNotFoundError and PermissionError
          # This is helpful because sometimes we get errors due to gfs not available
          # get_c2_model_dbg wraps URLError/HTTPErrors into generic Exception
          # Skip the tests if model can not be downloaded due to the any of the above
          print("\n_test_net exception: ", e)
          self.skipTest(str(e))
  
      # start to run the model and compare outputs
      n, c, h, w = input_blob_dims
      data = np.random.randn(n, c, h, w).astype(np.float32)
      inputs = [data]
      _, c2_outputs = c2_native_run_net(
          c2_init_net, c2_predict_net, inputs, debug_str
      )
      del _
  
      model = c2_onnx.caffe2_net_to_onnx_model(
          predict_net=c2_predict_net,
          init_net=c2_init_net,
          value_info=value_info,
      )
      c2_ir = c2.prepare(model)
      onnx_outputs = c2_ir.run(inputs)
      self.assertSameOutputs(c2_outputs, onnx_outputs, decimal=decimal)
  
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 2 for calling the TestCaffe2End2End obj's underlying member method code with example usage: obj._test_net(net_name, input_blob_dims, decimal) without return types