diff --git a/python/paddle/fluid/tests/unittests/test_nn_grad.py b/python/paddle/fluid/tests/unittests/test_nn_grad.py index b8c9d73e4f3c35796a983460b4d26f95a4a5d6ef..8dd1d294230895dab722be242db2915b37b04db1 100644 --- a/python/paddle/fluid/tests/unittests/test_nn_grad.py +++ b/python/paddle/fluid/tests/unittests/test_nn_grad.py @@ -96,8 +96,8 @@ class TestLeakyReluDoubleGradCheck(unittest.TestCase): class TestSqrtDoubleGradCheck(unittest.TestCase): @prog_scope() def func(self, place): - shape = [7, 9] - eps = 0.005 + shape = [3, 7] + eps = 0.0001 dtype = np.float64 x = layers.data('x', shape, False, dtype) @@ -107,9 +107,9 @@ class TestSqrtDoubleGradCheck(unittest.TestCase): x_arr = np.random.uniform(0.1, 1, shape).astype(dtype) gradient_checker.double_grad_check( - [x], y, x_init=x_arr, place=place, eps=eps, rtol=1e-2, atol=1e-2) + [x], y, x_init=x_arr, place=place, eps=eps) - def no_test_grad(self): + def test_grad(self): places = [fluid.CPUPlace()] if core.is_compiled_with_cuda(): places = [fluid.CUDAPlace(0)]