Skip to content

Commit

Permalink
fix windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ceci3 committed Dec 14, 2020
1 parent 6627245 commit e8bbb19
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions python/paddle/fluid/tests/unittests/test_nn_grad.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,25 +357,22 @@ class TestConstantPadDoubleGradCheckCase1(TestConstantPadDoubleGradCheck):
@prog_scope()
def func(self, place):
x_shape = [2, 3, 4, 5]
pad = [1, 2, 1, 2, 1, 2, 1, 2]
eps = 0.005
pad = [1, 1, 1, 1, 1, 1, 1, 1]
dtype = np.float64

x = layers.data('x', x_shape, False, dtype)
x.persistable = True
out = paddle.nn.functional.pad(x, pad)
x_arr = np.random.uniform(-1, 1, x_shape).astype(dtype)

gradient_checker.double_grad_check(
[x], out, x_init=x_arr, place=place, eps=eps)
gradient_checker.double_grad_check([x], out, x_init=x_arr, place=place)


class TestConcatDoubleGradCheck(unittest.TestCase):
@prog_scope()
def func(self, place):
x_shape = [2, 3, 4, 5]
pad = [1, 1, 1, 1]
eps = 0.005
dtype = np.float64

x1 = layers.data('x', x_shape, False, dtype)
Expand All @@ -387,7 +384,7 @@ def func(self, place):
x1_arr = np.random.uniform(-1, 1, x_shape).astype(dtype)

gradient_checker.double_grad_check(
[x1, x2], out, x_init=[x1_arr, x2_arr], place=place, eps=eps)
[x1, x2], out, x_init=[x1_arr, x2_arr], place=place)

def test_grad(self):
places = [fluid.CPUPlace()]
Expand Down

0 comments on commit e8bbb19

Please sign in to comment.