MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / make

Method make

src/serialization/impl/serializer.cpp:121–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121std::unique_ptr<GraphDumper> GraphDumper::make(
122 std::unique_ptr<OutputFile> file, GraphDumpFormat format, int version) {
123 switch (format) {
124 case GraphDumpFormat::FLATBUFFERS:
125#if MGB_ENABLE_FBS_SERIALIZATION
126 return make_fbs_dumper(std::move(file));
127#endif
128 MGB_FALLTHRU
129 case GraphDumpFormat::FLATBUFFERS_V2:
130#if MGB_ENABLE_FBS_SERIALIZATION
131 return make_fbs_v2_dumper(std::move(file), version);
132#endif
133 MGB_FALLTHRU
134 default:
135 mgb_throw(SerializationError, "unsupported serialization format requested");
136 }
137 mgb_assert(false, "unreachable");
138}
139
140std::unique_ptr<GraphLoader> GraphLoader::make(
141 std::unique_ptr<InputFile> file, GraphDumpFormat format) {

Callers 2

load_tensor_sharedMethod · 0.45
load_tensor_sharedMethod · 0.45

Calls 2

make_fbs_dumperFunction · 0.85
make_fbs_loaderFunction · 0.85

Tested by

no test coverage detected