helinwang-patch-1
Yu Yang 7 years ago
parent 0ef9edf566
commit 9fc0b596a9

@ -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();

@ -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)

Loading…
Cancel
Save