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

Method RemoveNode

tensorflow/core/graph/graph.cc:471–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

469}
470
471void Graph::RemoveNode(Node* node) {
472 TF_DCHECK_OK(IsValidNode(node)) << node->DebugString();
473 DCHECK(!node->IsSource());
474 DCHECK(!node->IsSink());
475
476 // Remove any edges involving this node.
477 for (const Edge* e : node->in_edges_) {
478 CHECK_EQ(e->src_->out_edges_.erase(e), size_t{1});
479 edges_[e->id_] = nullptr;
480 RecycleEdge(e);
481 --num_edges_;
482 }
483 node->in_edges_.clear();
484 for (const Edge* e : node->out_edges_) {
485 CHECK_EQ(e->dst_->in_edges_.erase(e), size_t{1});
486 edges_[e->id_] = nullptr;
487 RecycleEdge(e);
488 --num_edges_;
489 }
490 node->out_edges_.clear();
491 ReleaseNode(node);
492}
493
494const Edge* Graph::AddEdge(Node* source, int x, Node* dest, int y) {
495 TF_DCHECK_OK(IsValidNode(source)) << source->DebugString();

Callers 15

ReplaceNodeFunction · 0.45
RewriteCaseNodeFunction · 0.45
RewriteIfNodeFunction · 0.45
RewriteWhileNodeFunction · 0.45
RemoveIdentityNodesFunction · 0.45
RemoveListArrayConverterFunction · 0.45
InlineFunctionBodyFunction · 0.45
ComputeMethod · 0.45

Calls 5

IsSourceMethod · 0.80
IsSinkMethod · 0.80
DebugStringMethod · 0.45
eraseMethod · 0.45
clearMethod · 0.45

Tested by 3

TEST_FFunction · 0.36
BM_RemoveNodeFunction · 0.36
TESTFunction · 0.36