Add gradient check to reduce_max and reduce_min ops (#21985)

release/1.7
Qinghe JING 5 years ago committed by Tao Luo
parent 3fab86ffa6
commit 12b2b4b1a1

@ -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."""

Loading…
Cancel
Save