Skip to content

Commit 9fd76c4

Browse files
committed
Improve test_parallel_executor.
1 parent 129859e commit 9fd76c4

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
@@ -467,7 +467,7 @@ def test_parallel_testing(self):
467467
loss = simple_fc_net(True)
468468
test_program = main.clone(for_test=True)
469469

470-
opt = fluid.optimizer.SGD(learning_rate=0.0001)
470+
opt = fluid.optimizer.SGD(learning_rate=0.001)
471471
opt.minimize(loss)
472472

473473
batch_size = 32
@@ -494,4 +494,8 @@ def test_parallel_testing(self):
494494

495495
train_loss, = train_exe.run([loss.name], feed_dict=feed_dict)
496496
train_loss = numpy.array(train_loss)
497-
self.assertTrue(numpy.allclose(train_loss, test_loss))
497+
self.assertTrue(
498+
numpy.allclose(
499+
train_loss, test_loss, atol=1e-8),
500+
"Train loss: " + str(train_loss) + "\n Test loss:" +
501+
str(test_loss))

0 commit comments

Comments
 (0)