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

Function UpdatePending

tensorflow/core/distributed_runtime/scheduler.cc:52–70  ·  view source on GitHub ↗

Return true if the update makes the destination of the edge ready to run.

Source from the content-addressed store, hash-verified

50
51// Return true if the update makes the destination of the edge ready to run.
52bool UpdatePending(const Edge* edge, std::vector<int>* pending_count) {
53 const Node* out = edge->dst();
54 if (IsMerge(out)) {
55 if (edge->IsControlEdge()) {
56 (*pending_count)[out->id()] -= 2;
57 // Return true if we already got at least one input edge
58 // and a control edge is the enabling one.
59 return ((*pending_count)[out->id()] == 1);
60 } else {
61 int count = (*pending_count)[out->id()];
62 (*pending_count)[out->id()] |= 0x1;
63 // If the first input edge is the enabling one, the count goes from
64 // 0 to 1 in this step. Return true iff count was zero.
65 return (count == 0);
66 }
67 } else {
68 return (--(*pending_count)[out->id()] == 0);
69 }
70}
71
72} // end namespace
73

Callers 2

ComputeAsapMethod · 0.85
ComputeScheduleMethod · 0.85

Calls 4

IsMergeFunction · 0.50
dstMethod · 0.45
IsControlEdgeMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected