提交 1d23a748 authored 作者: Ian Goodfellow's avatar Ian Goodfellow

marked a test as KnownFailureTest--this test was only passing due to a

bug masking another bug commit bf5ecf94ebf0254eb0cd61b6082bd657ab4d402d fixed one bug and unmasked another
上级 e839d144
......@@ -20,6 +20,7 @@ from theano import tensor
import numpy
from theano.gof import Op, Apply
from theano.gradient import grad_undefined
from numpy.testing.noseclasses import KnownFailureTest
'''
Special Op created to test what happens when you have one op that is not
......@@ -159,8 +160,12 @@ class RopLop_checker(unittest.TestCase):
v1 = rop_f(vx, vv)
v2 = scan_f(vx, vv)
assert numpy.allclose(v1, v2), ('ROP mismatch: %s %s' % (v1, v2))
self.check_nondiff_rop(theano.clone(y,
known_fail = False
try:
self.check_nondiff_rop(theano.clone(y,
replace={self.x: break_op(self.x)}))
except AssertionError:
known_fail = True
# TEST LOP
......@@ -182,6 +187,11 @@ class RopLop_checker(unittest.TestCase):
v2 = scan_f(vx, vv)
assert numpy.allclose(v1, v2), ('LOP mismatch: %s %s' % (v1, v2))
if known_fail:
raise KnownFailureTest("Rop doesn't handle non-differentiable "
"inputs correctly. Bug exposed by fixing Add.grad"
" method.")
class test_RopLop(RopLop_checker):
def test_shape(self):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论