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

Function make_graph

src/netron_output.cpp:220–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218}
219
220value make_graph(const module* mod)
221{
222 value graph = {{"node", value({})},
223 {"initializer", value({})},
224 {"input", value({})},
225 {"output", value({})},
226 {"valueInfo", value({})}};
227 auto ins_uids = make_ins_uids(*mod);
228 for(auto ins = mod->begin(); ins != mod->end(); ++ins)
229 {
230 const auto& name = ins->name();
231 if(name == "@literal")
232 {
233 graph["initializer"].push_back(make_onnx_json_literal(ins, ins_uids));
234 }
235 else if(name == "@param")
236 {
237 graph["input"].push_back(make_onnx_json_in_out(ins, ins_uids));
238 }
239 else if(name == "@return")
240 {
241 graph["output"].push_back(make_onnx_json_in_out(ins, ins_uids));
242 }
243 else if(name.find("hip::hip_allocate_memory") != std::string::npos)
244 {
245 continue;
246 }
247 else
248 {
249 graph["node"].push_back(make_onnx_json_node(ins, ins_uids));
250 const auto& outputs = ins->outputs();
251 for(auto out_ins : outputs)
252 {
253 if(out_ins->name() != "@return")
254 {
255 graph["valueInfo"].push_back(make_onnx_json_edge(ins, out_ins, ins_uids));
256 }
257 }
258 }
259 }
260 return graph;
261}
262
263} // namespace
264

Callers 1

make_netron_outputFunction · 0.85

Calls 12

make_ins_uidsFunction · 0.85
make_onnx_json_literalFunction · 0.85
make_onnx_json_in_outFunction · 0.85
make_onnx_json_nodeFunction · 0.85
make_onnx_json_edgeFunction · 0.85
outputsMethod · 0.80
valueFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
nameMethod · 0.45
push_backMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected