MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / AddEdge

Method AddEdge

tensorflow/compiler/tf2tensorrt/segment/segment.cc:207–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205}
206
207void SimpleGraph::AddEdge(SimpleNode* src, int out_port, SimpleNode* dst,
208 int in_port) {
209 int i = edges_.size();
210 if (!free_edge_ids_.empty()) {
211 auto it = free_edge_ids_.begin();
212 i = *it;
213 free_edge_ids_.erase(it);
214 } else {
215 edges_.push_back(nullptr);
216 }
217 bool is_control = (out_port == Graph::kControlSlot);
218 is_control |= (in_port == Graph::kControlSlot);
219 auto edge = new SimpleEdge(i, src, out_port, dst, in_port, is_control);
220 edges_[i] = edge;
221 src->out_edges_.push_back(edge);
222 dst->in_edges_.push_back(edge);
223}
224
225void SimpleGraph::AddControlEdge(SimpleNode* src, SimpleNode* dst) {
226 AddEdge(src, Graph::kControlSlot, dst, Graph::kControlSlot);

Callers 15

CopySubgraphFunction · 0.45
BuildLoopBodyFunction · 0.45
FunctionalizeLoopFunction · 0.45
CompileSingleOpMethod · 0.45
BuildArgumentNodesMethod · 0.45
ExtractBodiesMethod · 0.45
AddInputEdgesMethod · 0.45
AddOutputEdgesMethod · 0.45
RemoveRedundantMergeMethod · 0.45
RemoveRedundantSwitchMethod · 0.45
AddArgNodesFunction · 0.45

Calls 5

sizeMethod · 0.45
emptyMethod · 0.45
beginMethod · 0.45
eraseMethod · 0.45
push_backMethod · 0.45

Tested by 3

TESTFunction · 0.36
TEST_FFunction · 0.36