Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rm eager guard tests part3_3 #49061

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions python/paddle/fluid/tests/unittests/test_complex_sum_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
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):
Expand All @@ -43,10 +42,6 @@ def test_complex_basic_api(self):
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()
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
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):
Expand All @@ -44,10 +43,6 @@ def test_basic_api(self):
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()
5 changes: 0 additions & 5 deletions python/paddle/fluid/tests/unittests/test_complex_transpose.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
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):
Expand All @@ -42,10 +41,6 @@ def test_transpose_by_complex_api(self):
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()
8 changes: 1 addition & 7 deletions python/paddle/fluid/tests/unittests/test_complex_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
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):
Expand Down Expand Up @@ -64,12 +64,6 @@ def test_convert_dtype(self):
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()
9 changes: 0 additions & 9 deletions python/paddle/fluid/tests/unittests/test_complex_view_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import paddle
from paddle import static
from paddle.fluid import dygraph
from paddle.fluid.framework import _test_eager_guard

paddle.enable_static()

Expand Down Expand Up @@ -106,10 +105,6 @@ def test_static(self):
[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):
Expand All @@ -133,10 +128,6 @@ def test_static(self):
[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()