diff --git a/python/paddle/tests/test_model.py b/python/paddle/tests/test_model.py index 809b25db5e47f85d681e6b03c98890b40b3625ed..96c4483a35ba835d34a81b645037da4ed0120f39 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()