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

Function GraphEdges

tensorflow/compiler/jit/encapsulate_subgraphs_pass_test.cc:724–734  ·  view source on GitHub ↗

Returns a sorted vector of (src, dst) edges in 'graph'.

Source from the content-addressed store, hash-verified

722
723// Returns a sorted vector of (src, dst) edges in 'graph'.
724std::vector<std::pair<string, string>> GraphEdges(const Graph& graph) {
725 std::vector<std::pair<string, string>> edges;
726 for (const Edge* edge : graph.edges()) {
727 if (edge->src()->IsSource() || edge->dst()->IsSink()) continue;
728 edges.emplace_back(
729 absl::StrCat(edge->src()->name(), ":", edge->src_output()),
730 absl::StrCat(edge->dst()->name(), ":", edge->dst_input()));
731 }
732 std::sort(edges.begin(), edges.end());
733 return edges;
734}
735
736TEST(EncapsulateSubgraphsTest, InputDeduplication) {
737 Scope root = Scope::NewRootScope().ExitOnError().WithDevice(

Callers 1

TESTFunction · 0.70

Calls 13

sortFunction · 0.85
edgesMethod · 0.80
IsSourceMethod · 0.80
IsSinkMethod · 0.80
nameMethod · 0.65
StrCatFunction · 0.50
srcMethod · 0.45
dstMethod · 0.45
emplace_backMethod · 0.45
src_outputMethod · 0.45
dst_inputMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected