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

Function GetClusters

tensorflow/compiler/jit/mark_for_compilation_pass_test.cc:51–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49REGISTER_OP("UncompilableUnary").Input("a: float").Output("o: float");
50
51std::unordered_map<string, string> GetClusters(const Graph& graph) {
52 std::unordered_map<string, string> ids;
53 for (Node* node : graph.nodes()) {
54 string cluster;
55 if (TryGetNodeAttr(node->attrs(), kXlaClusterAttr, &cluster)) {
56 CHECK(!cluster.empty());
57 ids[node->name()] = cluster;
58 }
59 }
60
61 if (VLOG_IS_ON(2)) {
62 VLOG(2) << "Clusters:";
63 for (const auto& p : ids) {
64 VLOG(2) << " " << p.first << " -> " << p.second;
65 }
66 }
67 return ids;
68}
69
70absl::flat_hash_map<string, std::vector<string>> GetClusterSets(
71 const Graph& g, std::vector<string>* cluster_names = nullptr) {

Callers 2

GetClusterSetsFunction · 0.70
TESTFunction · 0.70

Calls 4

nameMethod · 0.65
nodesMethod · 0.45
attrsMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected