code: def check_graph_executor_result(
      mod,
      map_inputs,
      out_shape,
      result,
      tol=1e-5,
      target="llvm",
      device=tvm.cpu(),
  ):
      with tvm.transform.PassContext(
          opt_level=3, disabled_pass=["AlterOpLayout"]
      ):
          executor_factory = relay.build(mod, target=target)
      lib = update_lib(executor_factory.lib)
      rt_mod = tvm.contrib.graph_executor.create(
          executor_factory.graph_json, lib, device
      )
  
      for name, data in map_inputs.items():
          rt_mod.set_input(name, data)
      rt_mod.run()
      out = tvm.nd.empty(out_shape, device=device)
      out = rt_mod.get_output(0, out)
  
      tvm.testing.assert_allclose(
          out.numpy(), result, rtol=tol, atol=tol
      )
  
file_path: tvm/tests/python/relay/utils/external_codegen.py
imports: import os
  import sys
  import pytest
  import tvm
  from tvm import relay, runtime, testing
  from tvm.contrib import utils
label_desc: Use image node_id 5 for calling a global function with example usage: check_graph_executor_result(mod, map_inputs, out_shape, result, tol, target, device) without return types