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 3ddf6df34c..7a9f33dc1e 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 a0504d3dbc..878c27d934 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 5e5299bda5..94ac393315 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