提交 5a9900cf authored 作者: Rebecca N. Palmer's avatar Rebecca N. Palmer

re-add min > max clip test with fixed reference

上级 ed1c6240
...@@ -2835,7 +2835,7 @@ ClipTester = makeTester( ...@@ -2835,7 +2835,7 @@ ClipTester = makeTester(
correct6=(randint(5, 5).astype('int64'), correct6=(randint(5, 5).astype('int64'),
np.array(-1, dtype='int64'), np.array(-1, dtype='int64'),
np.array(1, dtype='int64')), np.array(1, dtype='int64')),
# min > max case removed as numpy has changed # min > max case moved below as numpy has changed
correct8=(randint(0, 5).astype('uint8'), correct8=(randint(0, 5).astype('uint8'),
np.array(2, dtype='uint8'), np.array(2, dtype='uint8'),
np.array(4, dtype='uint8')), np.array(4, dtype='uint8')),
...@@ -2846,6 +2846,18 @@ ClipTester = makeTester( ...@@ -2846,6 +2846,18 @@ ClipTester = makeTester(
) )
# min > max case - numpy.clip has changed but we haven't
# https://github.com/Theano/Theano/issues/6715
BackwardsClipTester = makeTester(
name='BackwardsClipTester',
op=clip,
expected=lambda x, y, z: np.where(x < y, y, np.minimum(x, z)),
good=dict(correct7=((5 * rand(5, 5)).astype('float64'),
np.array(1, dtype='float64'),
np.array(-1, dtype='float64')),)
)
class T_Clip(unittest.TestCase): class T_Clip(unittest.TestCase):
def test_complex_value(self): def test_complex_value(self):
for dtype in ['complex64', 'complex128']: for dtype in ['complex64', 'complex128']:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论