| 67 | } |
| 68 | |
| 69 | void 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 | |
| 88 | void CheckGraph(const MutableGraphView& mutable_graph) { |
| 89 | GraphView immutable_graph(mutable_graph.graph()); |
no test coverage detected