Skip to content

Commit 6489080

Browse files
authored
Merge pull request #9849 from qingqing01/parallel_exe_test
Improve test_parallel_executor.
2 parents a64edbf + 9fd76c4 commit 6489080

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ def test_parallel_testing(self):
473473
loss = simple_fc_net(True)
474474
test_program = main.clone(for_test=True)
475475

476-
opt = fluid.optimizer.SGD(learning_rate=0.0001)
476+
opt = fluid.optimizer.SGD(learning_rate=0.001)
477477
opt.minimize(loss)
478478

479479
batch_size = 32
@@ -500,4 +500,8 @@ def test_parallel_testing(self):
500500

501501
train_loss, = train_exe.run([loss.name], feed_dict=feed_dict)
502502
train_loss = numpy.array(train_loss)
503-
self.assertTrue(numpy.allclose(train_loss, test_loss))
503+
self.assertTrue(
504+
numpy.allclose(
505+
train_loss, test_loss, atol=1e-8),
506+
"Train loss: " + str(train_loss) + "\n Test loss:" +
507+
str(test_loss))

0 commit comments

Comments
 (0)