From 3e56bfbfc534c946cda92583b746706fe167b80c Mon Sep 17 00:00:00 2001 From: LiuChiaChi <709153940@qq.com> Date: Sun, 27 Sep 2020 12:33:11 +0000 Subject: [PATCH] add random seed for test_export_deploy_model --- python/paddle/tests/test_model.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/paddle/tests/test_model.py b/python/paddle/tests/test_model.py index 809b25db5e4..96c4483a35b 100644 --- a/python/paddle/tests/test_model.py +++ b/python/paddle/tests/test_model.py @@ -516,6 +516,7 @@ class TestModelFunction(unittest.TestCase): def test_export_deploy_model(self): self.set_seed() + np.random.seed(2020) for dynamic in [True, False]: paddle.disable_static() if dynamic else None prog_translator = ProgramTranslator() @@ -589,6 +590,12 @@ class TestRaiseError(unittest.TestCase): with self.assertRaises(ValueError): model = Model(net, inputs, labels) + def test_static_without_inputs(self): + paddle.enable_static() + net = MyModel() + with self.assertRaises(TypeError): + model = Model(net) + def test_save_infer_model_without_inputs_and_run_in_dygraph(self): paddle.disable_static() net = MyModel() -- GitLab