From c924353d4f57b4b86862dc3224475bfca3f3e461 Mon Sep 17 00:00:00 2001 From: GaoWei8 <53294385+GaoWei8@users.noreply.github.com> Date: Tue, 17 Dec 2019 11:51:38 +0800 Subject: [PATCH] Remove self-set accuracy parameters of op tests: max_relative_error (#21740) --- python/paddle/fluid/tests/unittests/test_dropout_op.py | 2 +- .../paddle/fluid/tests/unittests/test_pad_constant_like.py | 2 +- .../paddle/fluid/tests/unittests/test_sequence_softmax_op.py | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/test_dropout_op.py b/python/paddle/fluid/tests/unittests/test_dropout_op.py index 29460d07dfd..cf66e703c82 100644 --- a/python/paddle/fluid/tests/unittests/test_dropout_op.py +++ b/python/paddle/fluid/tests/unittests/test_dropout_op.py @@ -36,7 +36,7 @@ class TestDropoutOp(OpTest): self.check_output() def test_check_grad_normal(self): - self.check_grad(['X'], 'Out', max_relative_error=0.05) + self.check_grad(['X'], 'Out') class TestDropoutOp2(TestDropoutOp): diff --git a/python/paddle/fluid/tests/unittests/test_pad_constant_like.py b/python/paddle/fluid/tests/unittests/test_pad_constant_like.py index 4abfa363faf..17cbd11bf7a 100644 --- a/python/paddle/fluid/tests/unittests/test_pad_constant_like.py +++ b/python/paddle/fluid/tests/unittests/test_pad_constant_like.py @@ -40,7 +40,7 @@ class TestPadOp(OpTest): self.check_output() def test_check_grad_normal(self): - self.check_grad(['Y'], 'Out', max_relative_error=0.006) + self.check_grad(['Y'], 'Out') def initTestCase(self): self.x_shape = (16, 16) diff --git a/python/paddle/fluid/tests/unittests/test_sequence_softmax_op.py b/python/paddle/fluid/tests/unittests/test_sequence_softmax_op.py index ca66ea3f844..eb956484de0 100644 --- a/python/paddle/fluid/tests/unittests/test_sequence_softmax_op.py +++ b/python/paddle/fluid/tests/unittests/test_sequence_softmax_op.py @@ -61,10 +61,9 @@ class TestSequenceSoftmaxOp(OpTest): def test_check_grad(self): if self.use_cudnn: place = core.CUDAPlace(0) - self.check_grad_with_place( - place, ["X"], "Out", max_relative_error=0.01) + self.check_grad_with_place(place, ["X"], "Out") else: - self.check_grad(["X"], "Out", max_relative_error=0.01) + self.check_grad(["X"], "Out") # ----------------cudnn Sequencesoftmax---------------- -- GitLab