From 12b2b4b1a1734bc6c7808d1c4dce4e5d84d14e9b Mon Sep 17 00:00:00 2001 From: Qinghe JING Date: Sat, 4 Jan 2020 13:03:50 +0800 Subject: [PATCH] Add gradient check to reduce_max and reduce_min ops (#21985) --- .../paddle/fluid/tests/unittests/test_reduce_op.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/python/paddle/fluid/tests/unittests/test_reduce_op.py b/python/paddle/fluid/tests/unittests/test_reduce_op.py index 20b850714f7..2a1f8d3d551 100644 --- a/python/paddle/fluid/tests/unittests/test_reduce_op.py +++ b/python/paddle/fluid/tests/unittests/test_reduce_op.py @@ -16,7 +16,7 @@ from __future__ import print_function import unittest import numpy as np -from op_test import OpTest +from op_test import OpTest, skip_check_grad_ci import paddle.fluid.core as core import paddle.fluid as fluid from paddle.fluid import compiler, Program, program_guard @@ -51,6 +51,9 @@ class TestMeanOp(OpTest): self.check_grad(['X'], 'Out') +@skip_check_grad_ci( + reason="reduce_max is discontinuous non-derivable function," + " its gradient check is not supported by unittest framework.") class TestMaxOp(OpTest): """Remove Max with subgradient from gradient check to confirm the success of CI.""" @@ -66,6 +69,9 @@ class TestMaxOp(OpTest): self.check_output() +@skip_check_grad_ci( + reason="reduce_min is discontinuous non-derivable function," + " its gradient check is not supported by unittest framework.") class TestMinOp(OpTest): """Remove Min with subgradient from gradient check to confirm the success of CI.""" @@ -271,6 +277,9 @@ class TestReduceMeanOpMultiAxises(OpTest): self.check_grad(['X'], 'Out') +@skip_check_grad_ci( + reason="reduce_max is discontinuous non-derivable function," + " its gradient check is not supported by unittest framework.") class TestReduceMaxOpMultiAxises(OpTest): """Remove Max with subgradient from gradient check to confirm the success of CI.""" @@ -286,6 +295,9 @@ class TestReduceMaxOpMultiAxises(OpTest): self.check_output() +@skip_check_grad_ci( + reason="reduce_min is discontinuous non-derivable function," + " its gradient check is not supported by unittest framework.") class TestReduceMinOpMultiAxises(OpTest): """Remove Min with subgradient from gradient check to confirm the success of CI.""" -- GitLab