From 659a719315ec6a09838e694b546a67f34295ccd6 Mon Sep 17 00:00:00 2001 From: minqiyang Date: Wed, 27 Feb 2019 21:57:01 +0800 Subject: [PATCH] increment resnet and ptbrnn's batch_num test=develop --- .../paddle/fluid/tests/unittests/test_imperative_ptb_rnn.py | 6 ++++-- .../paddle/fluid/tests/unittests/test_imperative_resnet.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/test_imperative_ptb_rnn.py b/python/paddle/fluid/tests/unittests/test_imperative_ptb_rnn.py index c8e42d5ede5..a0504d3dbc2 100644 --- a/python/paddle/fluid/tests/unittests/test_imperative_ptb_rnn.py +++ b/python/paddle/fluid/tests/unittests/test_imperative_ptb_rnn.py @@ -243,7 +243,9 @@ class TestImperativePtbRnn(unittest.TestCase): dy_loss = None last_hidden = None last_cell = None - for i in range(2): + batch_num = 200 + + for i in range(batch_num): x_data = np.arange(12).reshape(4, 3).astype('int64') y_data = np.arange(1, 13).reshape(4, 3).astype('int64') x_data = x_data.reshape((-1, num_steps, 1)) @@ -302,7 +304,7 @@ class TestImperativePtbRnn(unittest.TestCase): static_loss_value = None static_last_cell_value = None static_last_hidden_value = None - for i in range(2): + for i in range(batch_num): x_data = np.arange(12).reshape(4, 3).astype('int64') y_data = np.arange(1, 13).reshape(4, 3).astype('int64') x_data = x_data.reshape((-1, num_steps, 1)) diff --git a/python/paddle/fluid/tests/unittests/test_imperative_resnet.py b/python/paddle/fluid/tests/unittests/test_imperative_resnet.py index 9b5b4c8cef1..5e5299bda5f 100644 --- a/python/paddle/fluid/tests/unittests/test_imperative_resnet.py +++ b/python/paddle/fluid/tests/unittests/test_imperative_resnet.py @@ -231,7 +231,7 @@ class TestImperativeResnet(unittest.TestCase): seed = 90 batch_size = train_parameters["batch_size"] - batch_num = 2 + batch_num = 50 with fluid.imperative.guard(): fluid.default_startup_program().random_seed = seed fluid.default_main_program().random_seed = seed -- GitLab