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

Method print_py

src/program.cpp:1142–1161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1140}
1141
1142void program::print_py(std::ostream& os) const
1143{
1144 auto vec_modules = this->get_modules();
1145 std::unordered_map<instruction_ref, std::string> names;
1146 os << "p = migraphx.program()\n";
1147 for(auto& mod : vec_modules)
1148 {
1149 std::string var_name = "m";
1150 if(mod->name() != "main")
1151 var_name += mod->name();
1152 os << var_name << " = ";
1153 if(mod->name() == "main")
1154 os << "p.get_main_module()";
1155 else
1156 os << "p.create_module(\"" << mod->name() << "\");";
1157 os << std::endl;
1158 names = mod->print_py(os, var_name, names);
1159 os << std::endl;
1160 }
1161}
1162
1163void program::print_cpp(std::ostream& os) const
1164{

Callers

nothing calls this directly

Calls 2

get_modulesMethod · 0.95
nameMethod · 0.45

Tested by

no test coverage detected