Skip to content

Commit 8c11d3f

Browse files
committed
clean up
1 parent 0a89650 commit 8c11d3f

File tree

8 files changed

+7
-10
lines changed

8 files changed

+7
-10
lines changed

paddle/fluid/framework/details/fast_threaded_ssa_graph_executor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ FastThreadedSSAGraphExecutor::FastThreadedSSAGraphExecutor(
3333
pool_(strategy.num_threads_ +
3434
1), // add one more thread for generate op_deps
3535
fetch_ctxs_(places) {
36-
for (auto &op : ir::GetFilteredNodes<OpHandleBase>(*graph_)) {
36+
for (auto &op : ir::FilterByNodeWrapper<OpHandleBase>(*graph_)) {
3737
int dep = static_cast<int>(op->NotReadyInputSize());
3838
op_deps_.emplace(op, dep);
3939
if (dep == 0) {

paddle/fluid/framework/details/multi_devices_graph_check_pass.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ bool SSAGraghBuilderWithChecker::IsValidGraph(const ir::Graph *graph) const {
4646
insert_pending_var(var);
4747
}
4848

49-
for (OpHandleBase *op : ir::GetFilteredNodes<OpHandleBase>(*graph)) {
49+
for (OpHandleBase *op : ir::FilterByNodeWrapper<OpHandleBase>(*graph)) {
5050
if (op->Inputs().empty()) {
5151
ready_ops.insert(op);
5252
} else {

paddle/fluid/framework/details/multi_devices_graph_pass.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ namespace framework {
3636
namespace details {
3737

3838
namespace {
39+
// TODO(panyx0718): Clean this up as well.
3940
// all operators. NOTE that even we use a vector here, the operators is
4041
// unordered.
4142
typedef std::vector<OpHandleBase *> GraphOps;

paddle/fluid/framework/details/multi_devices_graph_print_pass.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void GraphvizSSAGraphPrinter::Print(const ir::Graph &graph,
6363
});
6464

6565
size_t op_id = 0;
66-
for (auto &op : ir::GetFilteredNodes<OpHandleBase>(graph)) {
66+
for (auto &op : ir::FilterByNodeWrapper<OpHandleBase>(graph)) {
6767
std::string op_name = "op_" + std::to_string(op_id++);
6868
sout << op_name << " [label=\"" << op->Name() << "\", shape=rect]"
6969
<< std::endl;

paddle/fluid/framework/details/reference_count_pass.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ std::unique_ptr<ir::Graph> ReferenceCountPass::ApplyImpl(
157157
}
158158
};
159159

160-
auto all_ops = ir::GetFilteredNodes<OpHandleBase>(*graph);
160+
auto all_ops = ir::FilterByNodeWrapper<OpHandleBase>(*graph);
161161
for (auto &op : all_ops) {
162162
auto in_var_names = get_ref_cnts_from_compute_op(op, op->Inputs());
163163
auto out_var_names = get_ref_cnts_from_compute_op(op, op->Outputs());

paddle/fluid/framework/details/threaded_ssa_graph_executor.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ FeedFetchList ThreadedSSAGraphExecutor::Run(
6060
InsertPendingVar(&pending_vars, ready_vars.get(), var);
6161
}
6262

63-
for (auto &op : ir::GetFilteredNodes<OpHandleBase>(*graph_)) {
63+
for (auto &op : ir::FilterByNodeWrapper<OpHandleBase>(*graph_)) {
6464
if (op->Inputs().empty()) { // Special case, Op has no input.
6565
ready_ops.insert(op);
6666
} else {

paddle/fluid/framework/ir/graph_helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ std::map<ir::Node *, std::unordered_set<ir::Node *>> BuildOperationAdjList(
3838
const Graph &graph);
3939

4040
template <typename T>
41-
std::vector<T *> GetFilteredNodes(const Graph &graph) {
41+
std::vector<T *> FilterByNodeWrapper(const Graph &graph) {
4242
std::vector<T *> ret;
4343
for (ir::Node *n : graph.Nodes()) {
4444
if (n->IsWrappedBy<T>()) ret.push_back(&n->Wrapper<T>());

python/paddle/fluid/tests/unittests/test_reader_reset.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
from __future__ import print_function
1616
import os
17-
import sys
1817
import paddle.fluid as fluid
1918
import paddle
2019
import numpy as np
@@ -91,13 +90,11 @@ def main(self, with_double_buffer):
9190
try:
9291
data_val, label_val = parallel_exe.run(fetch_list,
9392
return_numpy=True)
94-
sys.stderr.write('fetched %s\n' % label_val)
9593
ins_num = data_val.shape[0]
9694
broadcasted_label = np.ones((ins_num, ) + tuple(
9795
self.ins_shape)) * label_val.reshape((ins_num, 1))
9896
self.assertEqual(data_val.all(), broadcasted_label.all())
9997
for l in label_val:
100-
sys.stderr.write('label_val: %s\n' % l[0])
10198
self.assertFalse(data_appeared[l[0]])
10299
data_appeared[l[0]] = True
103100

@@ -107,7 +104,6 @@ def main(self, with_double_buffer):
107104
data_appeared = data_appeared[:-parallel_exe.device_count *
108105
self.batch_size]
109106
for i in data_appeared:
110-
sys.stderr.write('appeared %s\n' % i)
111107
self.assertTrue(i)
112108
if pass_count < self.test_pass_num:
113109
data_appeared = [False] * self.total_ins_num

0 commit comments

Comments
 (0)