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

Method get_model_io_info_dft

lite/src/mge/network_impl.cpp:1213–1226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1211}
1212
1213NetworkIO lite::get_model_io_info_dft(
1214 const std::string& model_path, const Config& config) {
1215 FILE* fin = fopen(model_path.c_str(), "rb");
1216 LITE_ASSERT(fin, "failed to open %s: %s", model_path.c_str(), strerror(errno));
1217 fseek(fin, 0, SEEK_END);
1218 size_t size = ftell(fin);
1219 fseek(fin, 0, SEEK_SET);
1220 void* ptr = malloc(size);
1221 std::shared_ptr<void> buf{ptr, ::free};
1222 auto nr = fread(buf.get(), 1, size, fin);
1223 LITE_ASSERT(nr == size);
1224 fclose(fin);
1225 return get_model_io_info_dft(ptr, size, config);
1226}
1227
1228NetworkIO lite::get_model_io_info_dft(
1229 const void* model_mem, size_t size, const Config& config) {

Callers

nothing calls this directly

Calls 11

makeFunction · 0.50
getMethod · 0.45
validMethod · 0.45
loadMethod · 0.45
layoutMethod · 0.45
push_backMethod · 0.45
get_infer_typeMethod · 0.45
nodeMethod · 0.45
infer_shape_fallibleMethod · 0.45
nameMethod · 0.45
dtypeMethod · 0.45

Tested by

no test coverage detected