diff --git a/python/paddle/fluid/tests/unittests/mlu/test_expand_v2_op_mlu.py b/python/paddle/fluid/tests/unittests/mlu/test_expand_v2_op_mlu.py index d7b1768d5097036e37015d7cc005fc7638b1c15a..cbc99c2fa66866619f9af1681e0f9891953f6532 100644 --- a/python/paddle/fluid/tests/unittests/mlu/test_expand_v2_op_mlu.py +++ b/python/paddle/fluid/tests/unittests/mlu/test_expand_v2_op_mlu.py @@ -25,6 +25,8 @@ from paddle.fluid import compiler, Program, program_guard import paddle from paddle.fluid.framework import _test_eager_guard +paddle.enable_static() + # Situation 1: shape is a list(without tensor) class TestExpandV2OpRank1(OpTest): @@ -304,5 +306,4 @@ class TestExpandV2DygraphAPI(unittest.TestCase): if __name__ == "__main__": - paddle.enable_static() unittest.main() diff --git a/python/paddle/fluid/tests/unittests/mlu/test_scatter_op_mlu.py b/python/paddle/fluid/tests/unittests/mlu/test_scatter_op_mlu.py index 0725a27e5125aef3b692930d1015fdb46fd6c863..d901813e3482ad03e80756d13cdf1620ca61e722 100644 --- a/python/paddle/fluid/tests/unittests/mlu/test_scatter_op_mlu.py +++ b/python/paddle/fluid/tests/unittests/mlu/test_scatter_op_mlu.py @@ -25,6 +25,8 @@ from op_test import OpTest import paddle.fluid.core as core from paddle.fluid.dygraph.base import switch_to_static_graph +paddle.enable_static() + class TestScatterOp(OpTest): @@ -243,5 +245,4 @@ class TestScatterInplaceAPI(TestScatterAPI): if __name__ == "__main__": - paddle.enable_static() unittest.main() diff --git a/python/paddle/fluid/tests/unittests/mlu/test_tile_op_mlu.py b/python/paddle/fluid/tests/unittests/mlu/test_tile_op_mlu.py index 1a2f5dbd40eb6ca1bdd7c250d3497c57722d9386..7c1e227ba2c074c74e355b428397627e4d43f022 100644 --- a/python/paddle/fluid/tests/unittests/mlu/test_tile_op_mlu.py +++ b/python/paddle/fluid/tests/unittests/mlu/test_tile_op_mlu.py @@ -24,6 +24,8 @@ import paddle import paddle.fluid as fluid from paddle.fluid import compiler, Program, program_guard +paddle.enable_static() + #Situation 1: repeat_times is a list (without tensor) class TestTileOpRank1(OpTest): @@ -277,5 +279,4 @@ class TestTileAPI(unittest.TestCase): if __name__ == "__main__": - paddle.enable_static() unittest.main() diff --git a/python/paddle/fluid/tests/unittests/mlu/test_where_op_mlu.py b/python/paddle/fluid/tests/unittests/mlu/test_where_op_mlu.py index 682a9e3909cc7fd68a86dfaed8c2ad69a60d7db0..3f1d553f7386ecf22c4f60d46d094f73f2b92f4e 100644 --- a/python/paddle/fluid/tests/unittests/mlu/test_where_op_mlu.py +++ b/python/paddle/fluid/tests/unittests/mlu/test_where_op_mlu.py @@ -29,6 +29,8 @@ from paddle.fluid.op import Operator from paddle.fluid.backward import append_backward from paddle.fluid.framework import _test_eager_guard +paddle.enable_static() + class TestWhereOp(OpTest): @@ -396,5 +398,4 @@ class TestWhereOpError(unittest.TestCase): if __name__ == "__main__": - paddle.enable_static() unittest.main()