Is there a way to serialize a tvm module into a string like the serialized engine in tensorrt?

In TensorRT a trt engine can be serialized and deserialized like this:

with open(“sample.engine”, “wb”) as f: 
    f.write(engine.serialize())
with open(“sample.engine”, “rb”) as f, trt.Runtime(TRT_LOGGER) as runtime: 
    engine = runtime.deserialize_cuda_engine(f.read())

In TVM a tvm module is alway saved as a shared library like this:

with relay.build_config(opt_level=3):
    _, resnet18_lib, _ = relay.build_module.build(resnet18_mod, "cuda", params=resnet18_params)
resnet18_lib.export_library("deploy.so")

Is there a way to serialize a tvm module into a string like the serialized engine in tensorrt?

You can try lib.save?

It may be not what I want. I want to find a way to implement these two paired functions for model serialization:

std::string serialize(tvm::runtime::Module model);

tvm::runtime::Module deserialize(std::string serialized_model);