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

Method CanContractEdge

tensorflow/compiler/jit/graphcycles/graphcycles.cc:361–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359}
360
361bool GraphCycles::CanContractEdge(int32 a, int32 b) {
362 CHECK(HasEdge(a, b)) << "No edge exists from " << a << " to " << b;
363 RemoveEdge(a, b);
364 bool reachable = IsReachableNonConst(a, b);
365 // Restore the graph to its original state.
366 InsertEdge(a, b);
367 // If reachable, then contracting edge will cause cycle.
368 return !reachable;
369}
370
371bool GraphCycles::ContractEdge(int32 a, int32 b) {
372 CHECK(HasEdge(a, b));

Callers 1

TEST_FFunction · 0.80

Calls 1

RemoveEdgeFunction · 0.85

Tested by 1

TEST_FFunction · 0.64