From 94c8ce3f13d73d0ab2d4d0c2adb8463c16f5747c Mon Sep 17 00:00:00 2001 From: minqiyang Date: Thu, 28 Feb 2019 12:11:28 +0800 Subject: [PATCH] reduce ut time test=develop --- paddle/fluid/imperative/layer.h | 5 +---- .../paddle/fluid/tests/unittests/test_imperative_ptb_rnn.py | 2 +- .../paddle/fluid/tests/unittests/test_imperative_resnet.py | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/paddle/fluid/imperative/layer.h b/paddle/fluid/imperative/layer.h index 3ddf6df34c2..7a9f33dc1e6 100644 --- a/paddle/fluid/imperative/layer.h +++ b/paddle/fluid/imperative/layer.h @@ -136,10 +136,7 @@ class VarBase { public: virtual ~VarBase() { - if (block_ && !persistable_) { - block_->RemoveVar(name_); - } - + // TODO(minqiyang): remove var desc from block desc if (var_) { delete var_; var_ = nullptr; 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 a0504d3dbc2..878c27d9344 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,7 @@ class TestImperativePtbRnn(unittest.TestCase): dy_loss = None last_hidden = None last_cell = None - batch_num = 200 + batch_num = 50 for i in range(batch_num): x_data = np.arange(12).reshape(4, 3).astype('int64') diff --git a/python/paddle/fluid/tests/unittests/test_imperative_resnet.py b/python/paddle/fluid/tests/unittests/test_imperative_resnet.py index 5e5299bda5f..94ac3933151 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 = 50 + batch_num = 20 with fluid.imperative.guard(): fluid.default_startup_program().random_seed = seed fluid.default_main_program().random_seed = seed -- GitLab