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

Function VerifyAttrs

tensorflow/core/graph/collective_order_test.cc:64–77  ·  view source on GitHub ↗

Verifies that the `wait_for` attribute on collective nodes matches `wait_for_map`.

Source from the content-addressed store, hash-verified

62// Verifies that the `wait_for` attribute on collective nodes matches
63// `wait_for_map`.
64void VerifyAttrs(
65 const Graph& graph,
66 const std::unordered_map<string, std::vector<int32>> wait_for_map) {
67 for (const Node* node : graph.nodes()) {
68 if (node->IsCollective() ||
69 wait_for_map.find(node->name()) == wait_for_map.end()) {
70 continue;
71 }
72 std::vector<int32> wait_for_actual;
73 TF_EXPECT_OK(GetNodeAttr(node->attrs(), "wait_for", &wait_for_actual));
74 auto wait_for_expected = wait_for_map.at(node->name());
75 EXPECT_THAT(wait_for_actual, UnorderedElementsAreArray(wait_for_expected));
76 }
77}
78
79Node* CollectiveReduceNode(GraphDefBuilder* builder, Node* input,
80 const string& name, const string& device,

Callers 1

TESTFunction · 0.85

Calls 8

IsCollectiveMethod · 0.80
nameMethod · 0.65
GetNodeAttrFunction · 0.50
nodesMethod · 0.45
findMethod · 0.45
endMethod · 0.45
attrsMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected