code: def test_save_load_model(use_vm, keras_simple, tmpdir_factory):
      pytest.importorskip("onnx")
  
      tmpdir = tmpdir_factory.mktemp("data")
      tvmc_model = tvmc.load(keras_simple)
  
      # Create tuning artifacts
      tvmc.tune(tvmc_model, target="llvm", trials=2)
  
      # Create package artifacts
      tvmc.compile(tvmc_model, target="llvm", use_vm=use_vm)
  
      # Save the model to disk
      model_path = os.path.join(tmpdir, "saved_model.tar")
      tvmc_model.save(model_path)
  
      # Load the model into a new TVMCModel
      new_tvmc_model = TVMCModel(model_path=model_path)
  
      # Check that the two models match.
      assert str(new_tvmc_model.mod) == str(tvmc_model.mod)
      # Check that tuning records and the compiled package are recoverable.
      assert path.exists(new_tvmc_model.default_package_path())
      assert path.exists(new_tvmc_model.default_tuning_records_path())
  
file_path: tvm/tests/python/driver/tvmc/test_model.py
imports: import platform
  import pytest
  import os
  import numpy
  from os import path
  from tvm.driver import tvmc
  from tvm.driver.tvmc.model import TVMCModel, TVMCPackage, TVMCResult
  from tvm.runtime.module import BenchmarkResult
label_desc: Use image node_id 2 for calling a global function with example usage: test_save_load_model(use_vm, keras_simple, tmpdir_factory) without return types