From 4ebf249b31fd95e95e1b18429e3dd2f635235efb Mon Sep 17 00:00:00 2001 From: phlrain Date: Sun, 20 Mar 2022 14:09:41 +0000 Subject: [PATCH] revert erf; test=develop --- python/paddle/fluid/tests/unittests/test_erfinv_op.py | 8 +++----- python/paddle/tensor/math.py | 2 -- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/test_erfinv_op.py b/python/paddle/fluid/tests/unittests/test_erfinv_op.py index 87eb740f04..847a868dd6 100644 --- a/python/paddle/fluid/tests/unittests/test_erfinv_op.py +++ b/python/paddle/fluid/tests/unittests/test_erfinv_op.py @@ -21,13 +21,13 @@ from op_test import OpTest import paddle import paddle.fluid.core as core +paddle.enable_static() np.random.seed(0) class TestErfinv(OpTest): def setUp(self): self.op_type = "erfinv" - self.python_api = paddle.erfinv self.init_dtype() self.shape = [11, 17] self.x = np.random.uniform(-1, 1, size=self.shape).astype(self.dtype) @@ -42,15 +42,14 @@ class TestErfinv(OpTest): self.dtype = np.float64 def test_check_output(self): - self.check_output(check_eager=False) + self.check_output() def test_check_grad(self): self.check_grad( ['X'], 'Out', user_defined_grads=[self.gradient], - user_defined_grad_outputs=self.grad_out, - check_eager=False) + user_defined_grad_outputs=self.grad_out) class TestErfinvFP32(TestErfinv): @@ -109,5 +108,4 @@ class TestErfinvAPI(unittest.TestCase): if __name__ == "__main__": - paddle.enable_static() unittest.main() diff --git a/python/paddle/tensor/math.py b/python/paddle/tensor/math.py index 380e840664..b9c4709df9 100755 --- a/python/paddle/tensor/math.py +++ b/python/paddle/tensor/math.py @@ -3440,8 +3440,6 @@ def erfinv(x, name=None): check_variable_and_dtype(x, 'x', ['float32', 'float64'], 'erfinv') if paddle.in_dynamic_mode(): - if _in_eager_mode(): - return _C_ops.final_state_erfinv( x ) return _C_ops.erfinv(x) helper = LayerHelper('erfinv', **locals()) -- GitLab