From f4138cf9123b8d4876193ba0cc1027dbf6d0f4a2 Mon Sep 17 00:00:00 2001 From: 0x45f <23097963+0x45f@users.noreply.github.com> Date: Thu, 2 Dec 2021 20:37:35 +0800 Subject: [PATCH] [Dy2Stat]Fix test_mnist_pure_fp16 (#37791) * fix test_mnist_pure_fp16 * change batch_id --- .../tests/unittests/dygraph_to_static/test_mnist_pure_fp16.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_mnist_pure_fp16.py b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_mnist_pure_fp16.py index 4ddc9d1aa0..1860362896 100644 --- a/python/paddle/fluid/tests/unittests/dygraph_to_static/test_mnist_pure_fp16.py +++ b/python/paddle/fluid/tests/unittests/dygraph_to_static/test_mnist_pure_fp16.py @@ -91,13 +91,13 @@ class TestPureFP16(TestMNIST): loss_data.append(avg_loss.numpy()[0]) # save checkpoint mnist.clear_gradients() - if batch_id % 10 == 0: + if batch_id % 2 == 0: print( "Loss at epoch {} step {}: loss: {:}, acc: {}, cost: {}" .format(epoch, batch_id, avg_loss.numpy(), acc.numpy(), time() - start)) start = time() - if batch_id == 50: + if batch_id == 10: break return loss_data -- GitLab