diff --git a/python/paddle/fluid/tests/unittests/test_conv2d_op.py b/python/paddle/fluid/tests/unittests/test_conv2d_op.py index aee693a54b90f2a4decfb3dd48d6a5af0f135dd0..70dda1ccdcf515fef613815ee5e1eefa5a2485db 100644 --- a/python/paddle/fluid/tests/unittests/test_conv2d_op.py +++ b/python/paddle/fluid/tests/unittests/test_conv2d_op.py @@ -151,19 +151,13 @@ def create_test_cudnn_fp16_class(parent, grad_check=True): place = core.CUDAPlace(0) if core.is_float16_supported(place) and grad_check: self.check_grad_with_place( - place, ['Input'], - 'Output', - max_relative_error=0.02, - no_grad_set=set(['Filter'])) + place, ['Input'], 'Output', no_grad_set=set(['Filter'])) def test_check_grad_no_input(self): place = core.CUDAPlace(0) if core.is_float16_supported(place) and grad_check: self.check_grad_with_place( - place, ['Filter'], - 'Output', - max_relative_error=0.02, - no_grad_set=set(['Input'])) + place, ['Filter'], 'Output', no_grad_set=set(['Input'])) cls_name = "{0}_{1}".format(parent.__name__, "CUDNNFp16") TestConv2DCUDNNFp16.__name__ = cls_name @@ -221,19 +215,13 @@ def create_test_cudnn_channel_last_fp16_class(parent, grad_check=True): place = core.CUDAPlace(0) if core.is_float16_supported(place) and grad_check: self.check_grad_with_place( - place, ['Input'], - 'Output', - max_relative_error=0.02, - no_grad_set=set(['Filter'])) + place, ['Input'], 'Output', no_grad_set=set(['Filter'])) def test_check_grad_no_input(self): place = core.CUDAPlace(0) if core.is_float16_supported(place) and grad_check: self.check_grad_with_place( - place, ['Filter'], - 'Output', - max_relative_error=0.02, - no_grad_set=set(['Input'])) + place, ['Filter'], 'Output', no_grad_set=set(['Input'])) def init_data_format(self): self.data_format = "NHWC" @@ -397,7 +385,6 @@ class TestConv2dOp(OpTest): self.check_grad_with_place( place, ['Filter'], 'Output', - max_relative_error=0.02, no_grad_set=set(['Input']), check_dygraph=(self.use_mkldnn == False)) @@ -827,7 +814,6 @@ class TestConv2dOp_v2(OpTest): self.check_grad_with_place( place, ['Filter'], 'Output', - max_relative_error=0.02, no_grad_set=set(['Input']), check_dygraph=(self.use_mkldnn == False)) diff --git a/python/paddle/fluid/tests/unittests/test_conv2d_transpose_op.py b/python/paddle/fluid/tests/unittests/test_conv2d_transpose_op.py index 38e6a6d9f472ed52bcaeb249e66d47f0831d7342..02b8aacaf2292b19884ff552c0becd09bd83ea29 100644 --- a/python/paddle/fluid/tests/unittests/test_conv2d_transpose_op.py +++ b/python/paddle/fluid/tests/unittests/test_conv2d_transpose_op.py @@ -160,26 +160,15 @@ class TestConv2dTransposeOp(OpTest): max_relative_error=0.02, no_grad_set=set(['Input'])) else: - self.check_grad( - ['Filter'], - 'Output', - max_relative_error=0.02, - no_grad_set=set(['Input'])) + self.check_grad(['Filter'], 'Output', no_grad_set=set(['Input'])) def test_check_grad_no_filter(self): if self.use_cudnn: place = core.CUDAPlace(0) self.check_grad_with_place( - place, ['Input'], - 'Output', - max_relative_error=0.02, - no_grad_set=set(['Filter'])) + place, ['Input'], 'Output', no_grad_set=set(['Filter'])) else: - self.check_grad( - ['Input'], - 'Output', - max_relative_error=0.02, - no_grad_set=set(['Filter'])) + self.check_grad(['Input'], 'Output', no_grad_set=set(['Filter'])) def test_check_grad(self): if self.use_cudnn: