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

Function EdgeIter

tensorflow/core/graph/graph_test.cc:374–385  ·  view source on GitHub ↗

Convert edge iteration results into a sorted string.

Source from the content-addressed store, hash-verified

372
373// Convert edge iteration results into a sorted string.
374static string EdgeIter(const Graph& g) {
375 std::vector<std::pair<int, int> > edges;
376 for (const Edge* e : g.edges()) {
377 edges.push_back(std::make_pair(e->src()->id(), e->dst()->id()));
378 }
379 std::sort(edges.begin(), edges.end());
380 string result;
381 for (auto& p : edges) {
382 strings::StrAppend(&result, p.first, "->", p.second, ";");
383 }
384 return result;
385}
386
387TEST_F(GraphTest, EdgeIteration) {
388 EXPECT_EQ("0->1;", EdgeIter(graph_));

Callers 1

TEST_FFunction · 0.85

Calls 9

sortFunction · 0.85
edgesMethod · 0.80
StrAppendFunction · 0.50
push_backMethod · 0.45
idMethod · 0.45
srcMethod · 0.45
dstMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected