MCPcopy Create free account
hub / github.com/apache/tvm-ffi / Serialize

Method Serialize

src/ffi/extra/serialization.cc:46–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44class ObjectGraphSerializer {
45 public:
46 static json::Value Serialize(const Any& value, const Any& metadata) {
47 ObjectGraphSerializer serializer;
48 json::Object result;
49 result.Set("root_index", serializer.GetOrCreateNodeIndex(value));
50 result.Set("nodes", std::move(serializer.nodes_));
51 if (metadata != nullptr) {
52 result.Set("metadata", metadata);
53 }
54 return result;
55 }
56
57 private:
58 ObjectGraphSerializer() = default;

Callers

nothing calls this directly

Calls 2

GetOrCreateNodeIndexMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected