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

Method write_to_file

src/plugin/impl/infkern_finder.cpp:274–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272}
273
274cg::OperatorNodeBase* InfkernFinder::write_to_file(const char* fpath) {
275 FILE* fout = fopen(fpath, "w");
276 mgb_assert(fout, "failed to open %s", fpath);
277
278 size_t subg_idx = 0;
279 cg::OperatorNodeBase* bad_opr = nullptr;
280 for (auto&& i : m_sub_graph_finders) {
281 fprintf(fout, "======== subgraph %zu ========\n"_fmt, subg_idx++);
282 auto o = i->write_to_file_opronly(fout);
283 if (!bad_opr && o)
284 bad_opr = o;
285 }
286
287 if (!m_sub_graph_finders.empty())
288 fprintf(fout, "======== parent graph ========\n");
289
290 auto self_bad_opr = write_to_file_opronly(fout);
291 if (!bad_opr)
292 bad_opr = self_bad_opr;
293
294 fclose(fout);
295
296 if (m_prev_succ_comp_seq_run_id == m_current_comp_seq->get_run_id())
297 return nullptr;
298
299 return bad_opr;
300}
301
302InfkernFinder::InputValueRecord::FullRecord InfkernFinder::get_input_values(
303 size_t opr_id) {

Callers 2

runMethod · 0.45
dump_to_jsonMethod · 0.45

Calls 3

write_to_file_opronlyMethod · 0.80
emptyMethod · 0.45
get_run_idMethod · 0.45

Tested by 1

runMethod · 0.36