From 65c8eac9fe4cfeff0b4da172125163f082bad9b2 Mon Sep 17 00:00:00 2001 From: GaoWei8 <53294385+GaoWei8@users.noreply.github.com> Date: Wed, 18 Dec 2019 10:21:27 +0800 Subject: [PATCH] Remove self-set accuracy parameters of op tests: max_relative_error (#21741) * Remove self-set accuracy parameters of op tests: max_relative_error test=develop * Remove self-set accuracy parameters of op tests: max_relative_error test=develop * Remove self-set parameters of op tests: max_relative_error test=develop --- .../paddle/fluid/tests/unittests/mkldnn/test_lrn_mkldnn_op.py | 2 +- python/paddle/fluid/tests/unittests/test_fsp_op.py | 2 +- python/paddle/fluid/tests/unittests/test_hinge_loss_op.py | 2 +- python/paddle/fluid/tests/unittests/test_huber_loss_op.py | 2 +- python/paddle/fluid/tests/unittests/test_mul_op.py | 4 ++-- python/paddle/fluid/tests/unittests/test_pad2d_op.py | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/mkldnn/test_lrn_mkldnn_op.py b/python/paddle/fluid/tests/unittests/mkldnn/test_lrn_mkldnn_op.py index e9b85dd7573..82acd820cd0 100644 --- a/python/paddle/fluid/tests/unittests/mkldnn/test_lrn_mkldnn_op.py +++ b/python/paddle/fluid/tests/unittests/mkldnn/test_lrn_mkldnn_op.py @@ -62,7 +62,7 @@ class TestLRNMKLDNNOpNHWC(TestLRNMKLDNNOp): #TODO(jczaja): Add grad support def test_check_grad_normal(self): with self.assertRaises(fluid.core_avx.EnforceNotMet): - self.check_grad(['X'], 'Out', max_relative_error=0.01) + self.check_grad(['X'], 'Out') if __name__ == "__main__": diff --git a/python/paddle/fluid/tests/unittests/test_fsp_op.py b/python/paddle/fluid/tests/unittests/test_fsp_op.py index 01991f4d36c..b6bf5227ac1 100644 --- a/python/paddle/fluid/tests/unittests/test_fsp_op.py +++ b/python/paddle/fluid/tests/unittests/test_fsp_op.py @@ -55,7 +55,7 @@ class TestFSPOp(OpTest): @unittest.skip("Disable temporarily.") def test_check_grad_normal(self): - self.check_grad(['X', 'Y'], 'Out', max_relative_error=0.05) + self.check_grad(['X', 'Y'], 'Out') if __name__ == '__main__': diff --git a/python/paddle/fluid/tests/unittests/test_hinge_loss_op.py b/python/paddle/fluid/tests/unittests/test_hinge_loss_op.py index f7b0c7e6aff..2e2d0d2ea48 100644 --- a/python/paddle/fluid/tests/unittests/test_hinge_loss_op.py +++ b/python/paddle/fluid/tests/unittests/test_hinge_loss_op.py @@ -37,7 +37,7 @@ class TestHingeLossOp(OpTest): self.check_output() def test_check_grad(self): - self.check_grad(['Logits'], 'Loss', max_relative_error=0.008) + self.check_grad(['Logits'], 'Loss') if __name__ == '__main__': diff --git a/python/paddle/fluid/tests/unittests/test_huber_loss_op.py b/python/paddle/fluid/tests/unittests/test_huber_loss_op.py index f2905248170..1c1b2f3ca33 100644 --- a/python/paddle/fluid/tests/unittests/test_huber_loss_op.py +++ b/python/paddle/fluid/tests/unittests/test_huber_loss_op.py @@ -53,7 +53,7 @@ class TestHuberLossOp(OpTest): self.check_output() def test_check_grad_normal(self): - self.check_grad(['X', 'Y'], 'Out', max_relative_error=0.008) + self.check_grad(['X', 'Y'], 'Out') def test_check_grad_ingore_x(self): self.check_grad( diff --git a/python/paddle/fluid/tests/unittests/test_mul_op.py b/python/paddle/fluid/tests/unittests/test_mul_op.py index 21d350170bf..f44b9756a8e 100644 --- a/python/paddle/fluid/tests/unittests/test_mul_op.py +++ b/python/paddle/fluid/tests/unittests/test_mul_op.py @@ -40,7 +40,7 @@ class TestMulOp(OpTest): self.check_output() def test_check_grad_normal(self): - self.check_grad(['X', 'Y'], 'Out', max_relative_error=0.5) + self.check_grad(['X', 'Y'], 'Out') def test_check_grad_ingore_x(self): self.check_grad( @@ -91,7 +91,7 @@ class TestMulOp2(OpTest): self.check_output() def test_check_grad_normal(self): - self.check_grad(['X', 'Y'], 'Out', max_relative_error=0.5) + self.check_grad(['X', 'Y'], 'Out') def test_check_grad_ingore_x(self): self.check_grad( diff --git a/python/paddle/fluid/tests/unittests/test_pad2d_op.py b/python/paddle/fluid/tests/unittests/test_pad2d_op.py index ff257ad1462..15486e88795 100644 --- a/python/paddle/fluid/tests/unittests/test_pad2d_op.py +++ b/python/paddle/fluid/tests/unittests/test_pad2d_op.py @@ -53,7 +53,7 @@ class TestPad2dOp(OpTest): self.check_output() def test_check_grad_normal(self): - self.check_grad(['X'], 'Out', max_relative_error=0.006) + self.check_grad(['X'], 'Out') def initTestCase(self): self.shape = (2, 3, 4, 5) -- GitLab