提交 fa1ff1d2 编写于 作者: M minqiyang

reduce ut time

test=develop
上级 659a7193
...@@ -127,10 +127,7 @@ class VarBase { ...@@ -127,10 +127,7 @@ class VarBase {
public: public:
virtual ~VarBase() { virtual ~VarBase() {
if (block_ && !persistable_) { // TODO(minqiyang): remove var desc from block desc
block_->RemoveVar(name_);
}
if (var_) { if (var_) {
delete var_; delete var_;
var_ = nullptr; var_ = nullptr;
......
...@@ -243,7 +243,7 @@ class TestImperativePtbRnn(unittest.TestCase): ...@@ -243,7 +243,7 @@ class TestImperativePtbRnn(unittest.TestCase):
dy_loss = None dy_loss = None
last_hidden = None last_hidden = None
last_cell = None last_cell = None
batch_num = 200 batch_num = 50
for i in range(batch_num): for i in range(batch_num):
x_data = np.arange(12).reshape(4, 3).astype('int64') x_data = np.arange(12).reshape(4, 3).astype('int64')
......
...@@ -231,7 +231,7 @@ class TestImperativeResnet(unittest.TestCase): ...@@ -231,7 +231,7 @@ class TestImperativeResnet(unittest.TestCase):
seed = 90 seed = 90
batch_size = train_parameters["batch_size"] batch_size = train_parameters["batch_size"]
batch_num = 50 batch_num = 20
with fluid.imperative.guard(): with fluid.imperative.guard():
fluid.default_startup_program().random_seed = seed fluid.default_startup_program().random_seed = seed
fluid.default_main_program().random_seed = seed fluid.default_main_program().random_seed = seed
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册