code: def run_generated_test(model_file, data_dir, device="CPU"):
      model = onnx.load(model_file)
      input_num = len(glob.glob(os.path.join(data_dir, "input_*.pb")))
      inputs = []
      for i in range(input_num):
          inputs.append(
              numpy_helper.to_array(
                  load_tensor_as_numpy_array(
                      os.path.join(data_dir, f"input_{i}.pb")
                  )
              )
          )
      output_num = len(glob.glob(os.path.join(data_dir, "output_*.pb")))
      outputs = []
      for i in range(output_num):
          outputs.append(
              numpy_helper.to_array(
                  load_tensor_as_numpy_array(
                      os.path.join(data_dir, f"output_{i}.pb")
                  )
              )
          )
      prepared = c2.prepare(model, device=device)
      c2_outputs = prepared.run(inputs)
      assert_similar(outputs, c2_outputs)
  
file_path: pytorch/test/onnx_caffe2/test_caffe2_common.py
imports: import glob
  import os
  import caffe2.python.onnx.backend
  import numpy
  import onnx.backend.test
  from onnx import numpy_helper
label_desc: Use image node_id 3 for calling a global function with example usage: run_generated_test(model_file, data_dir, device) without return types