MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / save

Method save

src/driver/main.cpp:433–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431 }
432
433 void save(const program& p) const
434 {
435 auto* os = &std::cout;
436 std::ofstream fs;
437 if(not output.empty())
438 {
439 fs.open(output, std::ios::binary);
440 os = &fs;
441 }
442
443 std::string type = output_type;
444 if(type.empty())
445 {
446 if(output.empty())
447 type = "text";
448 else
449 type = "binary";
450 }
451
452 if(type == "py")
453 p.print_py(*os);
454 else if(type == "cpp")
455 p.print_cpp(*os);
456 else if(type == "graphviz")
457 p.print_graph(*os, brief);
458 else if(type == "text")
459 *os << p << std::endl;
460 else if(type == "json")
461 *os << to_json_string(p.to_value()) << std::endl;
462 else if(type == "binary")
463 write(*os, save_buffer(p));
464 else if(type == "netron")
465 *os << make_netron_output(p) << std::endl;
466 }
467};
468
469struct program_params

Callers 15

mainFunction · 0.45
mainFunction · 0.45
test_conv_reluFunction · 0.45
test_load_save_argFunction · 0.45
compileMethod · 0.45
runMethod · 0.45
runMethod · 0.45
load_mgx_modelMethod · 0.45
save_imageMethod · 0.45
modify_modelFunction · 0.45
load_mgx_modelMethod · 0.45
save_imageMethod · 0.45

Calls 9

to_json_stringFunction · 0.85
save_bufferFunction · 0.85
make_netron_outputFunction · 0.85
openMethod · 0.80
emptyMethod · 0.45
print_pyMethod · 0.45
print_cppMethod · 0.45
print_graphMethod · 0.45
to_valueMethod · 0.45

Tested by 2

test_conv_reluFunction · 0.36
test_load_save_argFunction · 0.36