From 1a4f79a7dedfa962a87a51c56dd0f422ea73b8e2 Mon Sep 17 00:00:00 2001 From: Yancey1989 Date: Wed, 26 Dec 2018 19:01:53 +0800 Subject: [PATCH] fix unittest test=develop --- paddle/fluid/framework/details/build_strategy.cc | 1 + .../fluid/tests/unittests/test_parallel_executor_crf.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/framework/details/build_strategy.cc b/paddle/fluid/framework/details/build_strategy.cc index cb660cb8c2c..50426526023 100644 --- a/paddle/fluid/framework/details/build_strategy.cc +++ b/paddle/fluid/framework/details/build_strategy.cc @@ -153,6 +153,7 @@ std::unique_ptr BuildStrategy::Apply( pass->Erase("local_scopes"); pass->SetNotOwned>("local_scopes", &local_scopes); + pass->Erase("num_parallel_devices"); pass->Set("num_parallel_devices", new size_t(num_parallel_devices)); diff --git a/python/paddle/fluid/tests/unittests/test_parallel_executor_crf.py b/python/paddle/fluid/tests/unittests/test_parallel_executor_crf.py index 3e4490aa58e..41286ba08ca 100644 --- a/python/paddle/fluid/tests/unittests/test_parallel_executor_crf.py +++ b/python/paddle/fluid/tests/unittests/test_parallel_executor_crf.py @@ -211,7 +211,9 @@ class TestCRFModel(unittest.TestCase): use_cuda=True) self.check_network_convergence( - is_sparse=False, build_strategy=build_strategy, use_cuda=False) + is_sparse=False, + build_strategy=self._new_build_strategy(), + use_cuda=False) def test_update_sparse_parameter_reduce(self): if core.is_compiled_with_cuda(): -- GitLab