Skip to content

Commit df161e0

Browse files
committed
delete unuse ut
1 parent 49b5b3c commit df161e0

File tree

2 files changed

+1
-72
lines changed

2 files changed

+1
-72
lines changed

paddle/fluid/inference/analysis/data_flow_graph_tester.cc

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -160,77 +160,6 @@ TEST(DataFlowGraph, Build_IR_Graph) {
160160
ASSERT_EQ(graph.nodes.size(), ir_graph.Nodes().size());
161161
}
162162

163-
// FlexibleDFS
164-
/*
165-
* Graph topology
166-
* inputs: 0
167-
* 0 -> 1
168-
* 1 -> 2
169-
* 1 -> 3
170-
* 3 -> 4
171-
* 4 -> 5
172-
* 5 -> 2
173-
*/
174-
TEST(DataFlowGraph, flexibledfs) {
175-
DataFlowGraph graph;
176-
177-
for (int i = 0; i < 6; i++) {
178-
auto* node = graph.nodes.Create(Node::Type::kValue);
179-
node->SetName("node-" + std::to_string(i));
180-
}
181-
182-
auto add_link = [&](int i, int j) {
183-
Node* source = graph.nodes.GetMutable(i);
184-
Node* target = graph.nodes.GetMutable(j);
185-
target->inlinks.push_back(source);
186-
source->outlinks.push_back(target);
187-
};
188-
189-
add_link(0, 1);
190-
add_link(1, 2);
191-
add_link(1, 3);
192-
add_link(3, 4);
193-
add_link(4, 5);
194-
add_link(5, 2);
195-
graph.Build();
196-
197-
std::vector<const Node*> order;
198-
FlexibleDFS(graph.inputs(), false, nullptr, [&order](const Node* n) {
199-
order.push_back(n);
200-
return true;
201-
});
202-
203-
ASSERT_EQ(order.size(), 6UL);
204-
205-
order.clear();
206-
// reverse dfs
207-
FlexibleDFS(graph.outputs(), true, nullptr, [&order](const Node* n) {
208-
order.push_back(n);
209-
return true;
210-
});
211-
212-
ASSERT_EQ(order.size(), 6UL);
213-
214-
// If we delete
215-
Node* last_node = graph.nodes.GetMutable(2);
216-
Node* direct_node = graph.nodes.GetMutable(1);
217-
std::vector<Node*> source_nodes;
218-
for (Node* node : last_node->inlinks) {
219-
if (node != direct_node) source_nodes.push_back(node);
220-
}
221-
222-
bool has_cycle = false;
223-
FlexibleDFS(source_nodes, true, nullptr,
224-
[&has_cycle, direct_node](const Node* n) {
225-
if (n == direct_node) {
226-
has_cycle = true;
227-
return false;
228-
}
229-
return true;
230-
});
231-
ASSERT_TRUE(has_cycle);
232-
}
233-
234163
} // namespace analysis
235164
} // namespace inference
236165
} // namespace paddle

paddle/fluid/inference/analysis/subgraph_splitter.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void UnionContractedNodes(const std::unordered_map<int, BriefNode *> &node_map,
138138
}
139139
}
140140

141-
// FlexibleDfS
141+
// FlexibleDFS
142142
// If reverse is true, do reverse dfs.
143143
// If enter func is not nullptr, calls enter(node) before visiting any children
144144
// of node.

0 commit comments

Comments
 (0)