| 1211 | } |
| 1212 | |
| 1213 | NetworkIO 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 | |
| 1228 | NetworkIO lite::get_model_io_info_dft( |
| 1229 | const void* model_mem, size_t size, const Config& config) { |
nothing calls this directly
no test coverage detected