diff --git a/python/paddle/fluid/tests/unittests/mlu/test_clip_op_mlu.py b/python/paddle/fluid/tests/unittests/mlu/test_clip_op_mlu.py index c306ab96b61db24ad646b95ce325568df2340faf..1709d53895fd809b61e5c734b6a4b27cb7fec57d 100644 --- a/python/paddle/fluid/tests/unittests/mlu/test_clip_op_mlu.py +++ b/python/paddle/fluid/tests/unittests/mlu/test_clip_op_mlu.py @@ -21,7 +21,6 @@ import paddle import paddle.fluid as fluid from paddle.fluid import Program, program_guard from op_test import OpTest -from paddle.fluid.framework import _test_eager_guard paddle.enable_static() 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 f1e8b06cd9ab6fd0d68927ab5a230793e5fd30db..46d3d9d214fd7d05a021892692ad7189a1a3690f 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 @@ -21,7 +21,6 @@ from op_test import OpTest import paddle.fluid as fluid from paddle.fluid import compiler, Program, program_guard import paddle -from paddle.fluid.framework import _test_eager_guard paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/mlu/test_meshgrid_op_mlu.py b/python/paddle/fluid/tests/unittests/mlu/test_meshgrid_op_mlu.py index 6353ca638a5ce8ac80110bcc3c9310770bf35e4c..ecfb94e335b833e7d34e14de2ed84c170cacca1d 100644 --- a/python/paddle/fluid/tests/unittests/mlu/test_meshgrid_op_mlu.py +++ b/python/paddle/fluid/tests/unittests/mlu/test_meshgrid_op_mlu.py @@ -21,7 +21,6 @@ from op_test import OpTest, skip_check_grad_ci import paddle.fluid as fluid import paddle from paddle.fluid import compiler, Program, program_guard, core -from paddle.fluid.framework import _test_eager_guard paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/mlu/test_one_hot_v2_op_mlu.py b/python/paddle/fluid/tests/unittests/mlu/test_one_hot_v2_op_mlu.py index 3605ab254168dcb06c9d5073c61e9be9cc4189bc..b28d191fa2c3cd6f686eced3f33039e1dad8bc71 100644 --- a/python/paddle/fluid/tests/unittests/mlu/test_one_hot_v2_op_mlu.py +++ b/python/paddle/fluid/tests/unittests/mlu/test_one_hot_v2_op_mlu.py @@ -23,7 +23,7 @@ import paddle import paddle.fluid as fluid import paddle.fluid.core as core import paddle.fluid.framework as framework -from paddle.fluid.framework import Program, program_guard, _test_eager_guard +from paddle.fluid.framework import Program, program_guard paddle.enable_static() @@ -203,9 +203,8 @@ class TestOneHotOpApi(unittest.TestCase): one_hot_label = paddle.nn.functional.one_hot( fluid.dygraph.to_variable(label), depth ) - # with _test_eager_guard(): - # one_hot_label = paddle.nn.functional.one_hot( - # paddle.to_tensor(label), depth) + # one_hot_label = paddle.nn.functional.one_hot( + # paddle.to_tensor(label), depth) def _run(self, depth): label = fluid.layers.data(name="label", shape=[1], dtype="int64") diff --git a/python/paddle/fluid/tests/unittests/mlu/test_truncated_gaussian_random_op_mlu.py b/python/paddle/fluid/tests/unittests/mlu/test_truncated_gaussian_random_op_mlu.py index 98bcd7109d03702fb53958a45e88fc16de233ce7..b40cc3582ba3fc4eb639f1b525b945855612219f 100644 --- a/python/paddle/fluid/tests/unittests/mlu/test_truncated_gaussian_random_op_mlu.py +++ b/python/paddle/fluid/tests/unittests/mlu/test_truncated_gaussian_random_op_mlu.py @@ -24,7 +24,6 @@ sys.path.append("..") from op_test import OpTest from paddle.fluid.op import Operator from paddle.fluid.executor import Executor -from paddle.fluid.framework import _test_eager_guard paddle.enable_static() @@ -76,17 +75,16 @@ class TestTrunctedGaussianRandomOp(unittest.TestCase): # directly def gaussian_random_test_eager(self, place): with fluid.dygraph.guard(place): - with _test_eager_guard(): - out = paddle._C_ops.truncated_gaussian_random( - self.attrs["shape"], - self.attrs["mean"], - self.attrs["std"], - self.attrs["seed"], - core.VarDesc.VarType.FP32, - place, - ) - self.assertAlmostEqual(numpy.mean(out.numpy()), 0.0, delta=0.1) - self.assertAlmostEqual(numpy.var(out.numpy()), 0.773, delta=0.1) + out = paddle._C_ops.truncated_gaussian_random( + self.attrs["shape"], + self.attrs["mean"], + self.attrs["std"], + self.attrs["seed"], + core.VarDesc.VarType.FP32, + place, + ) + self.assertAlmostEqual(numpy.mean(out.numpy()), 0.0, delta=0.1) + self.assertAlmostEqual(numpy.var(out.numpy()), 0.773, delta=0.1) if __name__ == "__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 2bb780e1f268bebd245fd8b4a1934859bb7fee07..a2d0c1a699dba8b5e98e5d9020266be0e66289b3 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 @@ -25,7 +25,6 @@ from op_test import OpTest from paddle.fluid import compiler, Program, program_guard from paddle.fluid.op import Operator from paddle.fluid.backward import append_backward -from paddle.fluid.framework import _test_eager_guard paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/mlu/test_yolo_box_op_mlu.py b/python/paddle/fluid/tests/unittests/mlu/test_yolo_box_op_mlu.py index fd8855aeb570624529aa4bcea6ae9b29e34e5af2..60a9cfa05a556398c3591636492711aa3f742033 100644 --- a/python/paddle/fluid/tests/unittests/mlu/test_yolo_box_op_mlu.py +++ b/python/paddle/fluid/tests/unittests/mlu/test_yolo_box_op_mlu.py @@ -23,7 +23,6 @@ from paddle.fluid import core import paddle.fluid as fluid from paddle.fluid.op import Operator from paddle.fluid.executor import Executor -from paddle.fluid.framework import _test_eager_guard paddle.enable_static()