From 9fc0b596a92cf63e6c0df18b7f59842758411c5d Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Fri, 16 Mar 2018 15:39:52 +0800 Subject: [PATCH] Test more --- paddle/fluid/framework/parallel_executor.cc | 1 + .../paddle/fluid/tests/unittests/test_parallel_executor.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/framework/parallel_executor.cc b/paddle/fluid/framework/parallel_executor.cc index 25b31f86361..ea5ce3f2e9c 100644 --- a/paddle/fluid/framework/parallel_executor.cc +++ b/paddle/fluid/framework/parallel_executor.cc @@ -502,6 +502,7 @@ void ParallelExecutor::BCastParamsToGPUs( } } + // Debug code, bias should be 1.0f. for (auto &pair : member_->local_scopes_) { member_->GetNCCLCtx(pair.first).ctx_->Wait(); diff --git a/python/paddle/fluid/tests/unittests/test_parallel_executor.py b/python/paddle/fluid/tests/unittests/test_parallel_executor.py index 85a9f7697fa..2a614700b0a 100644 --- a/python/paddle/fluid/tests/unittests/test_parallel_executor.py +++ b/python/paddle/fluid/tests/unittests/test_parallel_executor.py @@ -45,7 +45,12 @@ class ParallelExecutor(unittest.TestCase): lod_levels=[0, 0], dtypes=['float32', 'int64']) img, label = fluid.layers.read_file(reader) - hidden = fluid.layers.fc(img, size=200, act='tanh') + hidden = fluid.layers.fc( + img, + size=200, + act='tanh', + bias_attr=fluid.ParamAttr( + initializer=fluid.initializer.Constant(value=1.0))) prediction = fluid.layers.fc(hidden, size=10, act='softmax') loss = fluid.layers.cross_entropy(input=prediction, label=label) loss = fluid.layers.mean(loss) -- GitLab