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

Function CheckEdges

tensorflow/compiler/jit/graphcycles/graphcycles_test.cc:146–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146static void CheckEdges(Nodes *nodes, Edges *edges,
147 tensorflow::GraphCycles *gc) {
148 int count = 0;
149 for (int i = 0; i != edges->size(); i++) {
150 int a = (*edges)[i].from;
151 int b = (*edges)[i].to;
152 if (!gc->HasEdge(a, b)) {
153 PrintEdges(edges);
154 PrintGCEdges(nodes, gc);
155 LOG(FATAL) << "!gc->HasEdge(" << a << ", " << b << ")";
156 }
157 }
158 for (int i = 0; i != nodes->size(); i++) {
159 for (int j = 0; j != nodes->size(); j++) {
160 int a = (*nodes)[i];
161 int b = (*nodes)[j];
162 if (gc->HasEdge(a, b)) {
163 count++;
164 }
165 }
166 }
167 if (count != edges->size()) {
168 PrintEdges(edges);
169 PrintGCEdges(nodes, gc);
170 LOG(FATAL) << "edges->size() " << edges->size() << " count " << count;
171 }
172}
173
174// Returns the index of a randomly chosen node in *nodes.
175// Requires *nodes be non-empty.

Callers 1

TESTFunction · 0.85

Calls 4

PrintEdgesFunction · 0.85
PrintGCEdgesFunction · 0.85
sizeMethod · 0.45
HasEdgeMethod · 0.45

Tested by

no test coverage detected