Skip to content

Commit

Permalink
fix grad.numpy in test_pylayer_op
Browse files Browse the repository at this point in the history
  • Loading branch information
pangyoki committed Apr 26, 2021
1 parent 4b7242b commit be50060
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/paddle/fluid/tests/unittests/test_pylayer_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ def backward(ctx, dy1, dy2):
z2 = paddle.tanh(input2) + paddle.tanh(input4)
z2.mean().backward()

self.assertTrue(np.max(np.abs((input1.grad - input2.grad))) < 1e-10)
self.assertTrue(
np.max(np.abs((input1.grad.numpy() - input2.grad.numpy()))) < 1e-10)

def test_simple_pylayer_single_output(self):
class tanh(PyLayer):
Expand Down

1 comment on commit be50060

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵️ CI failures summary

🔍PR: #32584 Commit ID: be50060 contains failed CI.

Please sign in to comment.