提交 4ebf249b 编写于 作者: P phlrain

revert erf; test=develop

上级 8b8cc481
...@@ -21,13 +21,13 @@ from op_test import OpTest ...@@ -21,13 +21,13 @@ from op_test import OpTest
import paddle import paddle
import paddle.fluid.core as core import paddle.fluid.core as core
paddle.enable_static()
np.random.seed(0) np.random.seed(0)
class TestErfinv(OpTest): class TestErfinv(OpTest):
def setUp(self): def setUp(self):
self.op_type = "erfinv" self.op_type = "erfinv"
self.python_api = paddle.erfinv
self.init_dtype() self.init_dtype()
self.shape = [11, 17] self.shape = [11, 17]
self.x = np.random.uniform(-1, 1, size=self.shape).astype(self.dtype) self.x = np.random.uniform(-1, 1, size=self.shape).astype(self.dtype)
...@@ -42,15 +42,14 @@ class TestErfinv(OpTest): ...@@ -42,15 +42,14 @@ class TestErfinv(OpTest):
self.dtype = np.float64 self.dtype = np.float64
def test_check_output(self): def test_check_output(self):
self.check_output(check_eager=False) self.check_output()
def test_check_grad(self): def test_check_grad(self):
self.check_grad( self.check_grad(
['X'], ['X'],
'Out', 'Out',
user_defined_grads=[self.gradient], user_defined_grads=[self.gradient],
user_defined_grad_outputs=self.grad_out, user_defined_grad_outputs=self.grad_out)
check_eager=False)
class TestErfinvFP32(TestErfinv): class TestErfinvFP32(TestErfinv):
...@@ -109,5 +108,4 @@ class TestErfinvAPI(unittest.TestCase): ...@@ -109,5 +108,4 @@ class TestErfinvAPI(unittest.TestCase):
if __name__ == "__main__": if __name__ == "__main__":
paddle.enable_static()
unittest.main() unittest.main()
...@@ -3440,8 +3440,6 @@ def erfinv(x, name=None): ...@@ -3440,8 +3440,6 @@ def erfinv(x, name=None):
check_variable_and_dtype(x, 'x', ['float32', 'float64'], 'erfinv') check_variable_and_dtype(x, 'x', ['float32', 'float64'], 'erfinv')
if paddle.in_dynamic_mode(): if paddle.in_dynamic_mode():
if _in_eager_mode():
return _C_ops.final_state_erfinv( x )
return _C_ops.erfinv(x) return _C_ops.erfinv(x)
helper = LayerHelper('erfinv', **locals()) helper = LayerHelper('erfinv', **locals())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册