未验证 提交 da63f99e 编写于 作者: 姜永久 提交者: GitHub

rm eager guard tests part3_3 (#49061)

上级 3fec7a6e
......@@ -21,7 +21,6 @@ import paddle
import paddle.fluid as fluid
import paddle.fluid.dygraph as dg
from paddle import tensor
from paddle.fluid.framework import _test_eager_guard
class TestComplexSumLayer(unittest.TestCase):
......@@ -43,10 +42,6 @@ class TestComplexSumLayer(unittest.TestCase):
target = np.sum(input, axis=(1, 2))
np.testing.assert_allclose(result, target, rtol=1e-05)
def test_eager(self):
with _test_eager_guard():
self.test_complex_basic_api()
if __name__ == '__main__':
unittest.main()
......@@ -20,7 +20,6 @@ from numpy.random import random as rand
import paddle.fluid as fluid
import paddle.fluid.dygraph as dg
from paddle import tensor
from paddle.fluid.framework import _test_eager_guard
class TestComplexTraceLayer(unittest.TestCase):
......@@ -44,10 +43,6 @@ class TestComplexTraceLayer(unittest.TestCase):
target = np.trace(input, offset=1, axis1=0, axis2=2)
np.testing.assert_allclose(result, target, rtol=1e-05)
def test_eager(self):
with _test_eager_guard():
self.test_basic_api()
if __name__ == '__main__':
unittest.main()
......@@ -19,7 +19,6 @@ import numpy as np
import paddle
import paddle.fluid as fluid
import paddle.fluid.dygraph as dg
from paddle.fluid.framework import _test_eager_guard
class TestComplexTransposeLayer(unittest.TestCase):
......@@ -42,10 +41,6 @@ class TestComplexTransposeLayer(unittest.TestCase):
trans = paddle.transpose(var, perm=perm)
np.testing.assert_allclose(trans.numpy(), np_trans, rtol=1e-05)
def test_eager(self):
with _test_eager_guard():
self.test_transpose_by_complex_api()
if __name__ == '__main__':
unittest.main()
......@@ -20,7 +20,7 @@ import paddle
import paddle.fluid.core as core
import paddle.fluid.dygraph as dg
from paddle.fluid.data_feeder import convert_dtype
from paddle.fluid.framework import _test_eager_guard, convert_np_dtype_to_dtype_
from paddle.fluid.framework import convert_np_dtype_to_dtype_
class TestComplexVariable(unittest.TestCase):
......@@ -64,12 +64,6 @@ class TestComplexVariable(unittest.TestCase):
convert_dtype(core.VarDesc.VarType.COMPLEX128), "complex128"
)
def test_eager(self):
with _test_eager_guard():
self.test_attrs()
self.test_convert_np_dtype_to_dtype()
self.test_convert_dtype()
if __name__ == '__main__':
unittest.main()
......@@ -20,7 +20,6 @@ from op_test import OpTest
import paddle
from paddle import static
from paddle.fluid import dygraph
from paddle.fluid.framework import _test_eager_guard
paddle.enable_static()
......@@ -106,10 +105,6 @@ class TestViewAsComplexAPI(unittest.TestCase):
[out_np] = exe.run(mp, feed={"x": self.x}, fetch_list=[out])
np.testing.assert_allclose(self.out, out_np, rtol=1e-05)
def test_eager(self):
with _test_eager_guard():
self.test_dygraph()
class TestViewAsRealAPI(unittest.TestCase):
def setUp(self):
......@@ -133,10 +128,6 @@ class TestViewAsRealAPI(unittest.TestCase):
[out_np] = exe.run(mp, feed={"x": self.x}, fetch_list=[out])
np.testing.assert_allclose(self.out, out_np, rtol=1e-05)
def test_eager(self):
with _test_eager_guard():
self.test_dygraph()
if __name__ == "__main__":
unittest.main()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册