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

Function RemoveDeadNodes

tensorflow/core/common_runtime/function.cc:1333–1343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1331}
1332
1333bool RemoveDeadNodes(Graph* g) {
1334 VLOG(2) << "Removing dead nodes";
1335 std::unordered_set<const Node*> nodes;
1336 for (auto n : g->nodes()) {
1337 if (n->IsSource() || n->IsSink() || n->IsControlFlow() ||
1338 n->op_def().is_stateful()) {
1339 nodes.insert(n);
1340 }
1341 }
1342 return PruneForReverseReachability(g, std::move(nodes));
1343}
1344
1345namespace {
1346// If 'edges' contains only 1 non-control edge, returns it. Otherwise,

Callers 1

OptimizeMethod · 0.85

Calls 8

IsSourceMethod · 0.80
IsSinkMethod · 0.80
IsControlFlowMethod · 0.80
nodesMethod · 0.45
is_statefulMethod · 0.45
op_defMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected