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

Method CompareNodes

tensorflow/core/grappler/utils/grappler_test.cc:153–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153void GrapplerTest::CompareNodes(const NodeDef& want, const NodeDef& got) const {
154 EXPECT_EQ(want.name(), got.name());
155 EXPECT_EQ(want.op(), got.op());
156
157 std::vector<string> want_inputs(want.input().begin(), want.input().end());
158 std::vector<string> got_inputs(got.input().begin(), got.input().end());
159 EXPECT_EQ(want_inputs, got_inputs);
160
161 const auto attr_name = [](const std::pair<const string, AttrValue>& attr) {
162 return attr.first;
163 };
164
165 std::vector<string> want_attrs;
166 std::vector<string> got_attrs;
167 absl::c_transform(want.attr(), std::back_inserter(want_attrs), attr_name);
168 absl::c_transform(got.attr(), std::back_inserter(got_attrs), attr_name);
169 absl::c_sort(want_attrs);
170 absl::c_sort(got_attrs);
171 EXPECT_EQ(want_attrs, got_attrs);
172
173 for (const string& attr : want_attrs) {
174 EXPECT_TRUE(AreAttrValuesEqual(want.attr().at(attr), got.attr().at(attr)));
175 }
176}
177
178bool GrapplerTest::IsNodesDirectlyConnected(const NodeMap& node_map,
179 const string& src,

Callers

nothing calls this directly

Calls 8

AreAttrValuesEqualFunction · 0.85
attrMethod · 0.80
nameMethod · 0.65
opMethod · 0.45
beginMethod · 0.45
inputMethod · 0.45
endMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected