| 39 | } |
| 40 | |
| 41 | static void write_file(const char* file_name, void* ptr, size_t length) { |
| 42 | FILE* fout = fopen(file_name, "wb"); |
| 43 | if (!fout) { |
| 44 | fprintf(stderr, "Open file error!!\n"); |
| 45 | return; |
| 46 | } |
| 47 | size_t write_bytes = fwrite(ptr, 1, length, fout); |
| 48 | EXAMPLE_ASSERT(write_bytes == length); |
| 49 | fclose(fout); |
| 50 | } |
| 51 | |
| 52 | static inline void run_model( |
| 53 | LiteNetwork model, const char* output_dir, int instance_cnt, |