code: def test_save_load():
      x = relay.var("x", shape=(10, 10))
      f = relay.Function([x], x + x)
      x_data = np.random.rand(10, 10).astype("float32")
  
      # serialize.
      vm = create_exec(f)
      code, lib = vm.save()
      assert isinstance(code, bytearray)
  
      # save and load the code and lib file.
      tmp = utils.tempdir()
      path_lib = tmp.relpath("lib.so")
      lib.export_library(path_lib)
      with open(tmp.relpath("code.ro"), "wb") as fo:
          fo.write(code)
  
      loaded_lib = tvm.runtime.load_module(path_lib)
      loaded_code = bytearray(open(tmp.relpath("code.ro"), "rb").read())
  
      # deserialize.
      des_exec = _vm.Executable.load_exec(loaded_code, loaded_lib)
      des_vm = _vm.VirtualMachine(des_exec, tvm.cpu())
  
      res = des_vm.run(x_data)
      tvm.testing.assert_allclose(res.numpy(), x_data + x_data)
  
imports: import pytest
  import numpy
  import tvm
  from tvm.runtime import vm
  from tvm.relay import vm
  from tvm import relay
  from tvm.relay.scope_builder import ScopeBuilder
  from tvm.relay import transform
  from tvm.relay.prelude import Prelude
  from tvm.contrib import utils
  from tvm.relay import testing
label_desc: Use image node_id 5 for calling a global function with example usage: test_save_load() without return types