tvm_ffi.serialization.to_json_graph_str#
- tvm_ffi.serialization.to_json_graph_str(obj, metadata=None)[source]#
Dump an object to a JSON graph string.
The JSON graph is a textual representation of the object graph that preserves shared references. It can be used for debugging or simple persistence.
- Parameters:
- Return type:
- Returns:
json_str – The JSON graph string.
Examples
import tvm_ffi a = tvm_ffi.convert([1, 2, 3]) s = tvm_ffi.serialization.to_json_graph_str(a) b = tvm_ffi.serialization.from_json_graph_str(s) assert list(b) == [1, 2, 3]