Skip to content

Commit bae3659

Browse files
committed
more test
test=develop
1 parent 44ecf9a commit bae3659

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

paddle/fluid/pybind/pybind.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -650,9 +650,9 @@ All parameter, weight, gradient are variables in Paddle.
650650
[](ir::Pass &self, const std::string &name, const std::string &attr) {
651651
self.Set<std::string>(name, new std::string(attr));
652652
})
653-
.def("set_int", [](ir::Pass &self, const std::string &name, int val) {
654-
self.Set<const int>(name, new int(val));
655-
});
653+
.def("set_int", [](ir::Pass &self, const std::string &name,
654+
int val) { self.Set<const int>(name, new int(val)); })
655+
.def("type", &ir::Pass::Type);
656656

657657
py::class_<ir::PassBuilder, std::shared_ptr<ir::PassBuilder>> pb(
658658
m, "PassBuilder");

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ def check_network_convergence(self, use_cuda, build_strategy=None):
9494

9595
def test_parallel_testing_with_new_strategy(self):
9696
build_strategy = fluid.BuildStrategy()
97+
self.assertFalse(build_strategy.fuse_elewise_add_act_ops)
98+
build_strategy.fuse_elewise_add_act_ops = True
9799
pass_builder = build_strategy._finalize_strategy_and_create_passes()
100+
self.assertTrue("fuse_elewise_add_act_pass" in
101+
[p.type() for p in pass_builder.all_passes()])
102+
98103
origin_len = len(pass_builder.all_passes())
99104

100105
viz_pass = pass_builder.append_pass("graph_viz_pass")

0 commit comments

Comments
 (0)