提交 707a4213 编写于 作者: L LiuChiaChi

set paddle manual seed for unittest

上级 7afd7d4b
...@@ -618,7 +618,6 @@ class DynamicGraphAdapter(object): ...@@ -618,7 +618,6 @@ class DynamicGraphAdapter(object):
# TODO multi device in dygraph mode not implemented at present time # TODO multi device in dygraph mode not implemented at present time
def train_batch(self, inputs, labels=None): def train_batch(self, inputs, labels=None):
assert self.model._optimizer, \ assert self.model._optimizer, \
"model not ready, please call `model.prepare()` first" "model not ready, please call `model.prepare()` first"
self.model.network.train() self.model.network.train()
...@@ -1858,7 +1857,6 @@ class Model(object): ...@@ -1858,7 +1857,6 @@ class Model(object):
] ]
self._is_shape_inferred = True self._is_shape_inferred = True
self._inputs = self._verify_spec(None, self._shapes, True) self._inputs = self._verify_spec(None, self._shapes, True)
if mode == 'test': if mode == 'test':
return logs, outputs return logs, outputs
return logs return logs
......
...@@ -515,6 +515,7 @@ class TestModelFunction(unittest.TestCase): ...@@ -515,6 +515,7 @@ class TestModelFunction(unittest.TestCase):
paddle.summary(nlp_net, (1, 1, 2)) paddle.summary(nlp_net, (1, 1, 2))
def test_export_deploy_model(self): def test_export_deploy_model(self):
self.set_seed()
for dynamic in [True, False]: for dynamic in [True, False]:
paddle.disable_static() if dynamic else None paddle.disable_static() if dynamic else None
prog_translator = ProgramTranslator() prog_translator = ProgramTranslator()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册