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

Method print_graph

src/module.cpp:1278–1304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1276}
1277
1278void module::print_graph(std::ostream& os, bool brief) const
1279{
1280 os << "digraph {" << std::endl;
1281 os << "\trankdir=LR;" << std::endl;
1282
1283 this->print([&](auto ins, auto ins_names) {
1284 std::string label;
1285 if(brief)
1286 label = ins->name();
1287 else
1288 label = to_string(ins->get_operator());
1289 os << "\t" << enclose_name(ins_names.at(ins)) << "[label=" << enclose_name(label) << "]";
1290 os << ";" << std::endl;
1291 if(not ins->inputs().empty())
1292 {
1293 for(auto&& arg : ins->inputs())
1294 {
1295 os << "\t" << enclose_name(ins_names.at(arg)) << " -> "
1296 << enclose_name(ins_names.at(ins));
1297 if(not brief)
1298 os << "[label=" << enclose_name(to_string(ins->get_shape())) << "]";
1299 os << ";" << std::endl;
1300 }
1301 }
1302 });
1303 os << "}" << std::endl;
1304}
1305
1306static std::string cpp_var_name(const std::string& name)
1307{

Callers 3

TEST_CASEFunction · 0.45
TEST_CASEFunction · 0.45
saveMethod · 0.45

Calls 8

printMethod · 0.95
atMethod · 0.80
enclose_nameFunction · 0.70
to_stringFunction · 0.50
nameMethod · 0.45
emptyMethod · 0.45
inputsMethod · 0.45
get_shapeMethod · 0.45

Tested by 2

TEST_CASEFunction · 0.36
TEST_CASEFunction · 0.36