MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / remove_node

Method remove_node

src/graph/Graph.cpp:35–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35bool Graph::remove_node(NodeID nid)
36{
37 if (nid >= _nodes.size())
38 {
39 return false;
40 }
41
42 std::unique_ptr<INode> &node = _nodes[nid];
43
44 if (node)
45 {
46 // Remove input connections
47 for (auto &input_eid : node->_input_edges)
48 {
49 remove_connection(input_eid);
50 }
51
52 // Remove output connections
53 std::set<EdgeID> output_edges_copy = node->output_edges();
54 for (auto &output_eid : output_edges_copy)
55 {
56 remove_connection(output_eid);
57 }
58
59 // Remove nid from tagged nodes
60 std::vector<NodeID> &tnodes = _tagged_nodes.at(node->type());
61 tnodes.erase(std::remove(tnodes.begin(), tnodes.end(), nid), tnodes.end());
62 }
63
64 node = nullptr;
65
66 return true;
67}
68
69EdgeID Graph::add_connection(NodeID source, size_t source_idx, NodeID sink, size_t sink_idx)
70{

Calls 4

sizeMethod · 0.45
typeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected