diff --git a/python/paddle/fluid/tests/unittests/test_erfinv_op.py b/python/paddle/fluid/tests/unittests/test_erfinv_op.py index 87eb740f041134d18718ffabe6a55f4f65afc726..847a868dd6ca01f32e9e58cf1620aca50f042602 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 380e840664f584fe754aa418aba9d94ac4af4902..b9c4709df9efeca29fa10406025d0ef44665aae2 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())