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

Function CheckNode

tensorflow/core/grappler/mutable_graph_view_test.cc:69–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69void CheckNode(const MutableGraphView& graph, absl::string_view node_name,
70 absl::string_view op, absl::string_view device,
71 absl::Span<const std::pair<string, FDH::AttrValueWrapper>> attrs,
72 absl::Span<const string> fanins,
73 absl::Span<const string> fanouts) {
74 NodeDef* node = graph.GetNode(node_name);
75 ASSERT_NE(node, nullptr);
76 EXPECT_EQ(node->op(), op);
77 EXPECT_EQ(node->device(), device);
78 EXPECT_EQ(node->attr_size(), attrs.size());
79 for (const auto& attr : attrs) {
80 auto it = node->attr().find(attr.first);
81 ASSERT_NE(it, node->attr().end());
82 EXPECT_TRUE(AreAttrValuesEqual(it->second, attr.second.proto));
83 }
84 CompareNodeFanins(graph, node, fanins);
85 CompareNodeFanouts(graph, node, fanouts);
86}
87
88void CheckGraph(const MutableGraphView& mutable_graph) {
89 GraphView immutable_graph(mutable_graph.graph());

Callers 7

TESTFunction · 0.85
TestSwapNodeNamesFunction · 0.85
TestSwapNodeNamesErrorFunction · 0.85

Calls 10

AreAttrValuesEqualFunction · 0.85
CompareNodeFaninsFunction · 0.85
CompareNodeFanoutsFunction · 0.85
attrMethod · 0.80
GetNodeMethod · 0.45
opMethod · 0.45
deviceMethod · 0.45
sizeMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected