提交 c555a320 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Reference Trac tickets in KnownFailureTests error messages

上级 418f4dc8
...@@ -2323,8 +2323,10 @@ class T_tensorfromscalar(unittest.TestCase): ...@@ -2323,8 +2323,10 @@ class T_tensorfromscalar(unittest.TestCase):
self.failUnless(isinstance(v, numpy.ndarray)) self.failUnless(isinstance(v, numpy.ndarray))
self.failUnless(v.shape == (), v.shape) self.failUnless(v.shape == (), v.shape)
@dec.knownfailureif(isinstance(get_default_mode(),theano.compile.debugmode.DebugMode), @dec.knownfailureif(
"This test fail in DEBUG_MODE but this don't make theano generate some bad code. It is a trouble with DEBUG_MODE") isinstance(get_default_mode(),theano.compile.debugmode.DebugMode),
("This test fails in DEBUG_MODE, but the generated code is OK. "
"It is actually a problem of DEBUG_MODE, see #624."))
def test1(self): def test1(self):
s = scal.constant(56) s = scal.constant(56)
t = as_tensor_variable(s) t = as_tensor_variable(s)
...@@ -2343,8 +2345,10 @@ class T_tensorfromscalar(unittest.TestCase): ...@@ -2343,8 +2345,10 @@ class T_tensorfromscalar(unittest.TestCase):
self.failUnless(eval_outputs([g])==1) self.failUnless(eval_outputs([g])==1)
class T_scalarfromtensor(unittest.TestCase): class T_scalarfromtensor(unittest.TestCase):
@dec.knownfailureif(isinstance(get_default_mode(),theano.compile.debugmode.DebugMode), @dec.knownfailureif(
"This test fail in DEBUG_MODE but this don't make theano generate some bad code. It is a trouble with DEBUG_MODE") isinstance(get_default_mode(),theano.compile.debugmode.DebugMode),
("This test fails in DEBUG_MODE, but the generated code is OK. "
"It is actually a problem of DEBUG_MODE, see #625."))
def test0(self): def test0(self):
tt = constant(56)#scal.constant(56) tt = constant(56)#scal.constant(56)
ss = scalar_from_tensor(tt) ss = scalar_from_tensor(tt)
...@@ -3309,8 +3313,10 @@ def test_sum_overflow(): ...@@ -3309,8 +3313,10 @@ def test_sum_overflow():
f = function([a], sum(a)) f = function([a], sum(a))
assert f([1]*300) == 300 assert f([1]*300) == 300
@dec.knownfailureif(isinstance(get_default_mode(),theano.compile.debugmode.DebugMode), @dec.knownfailureif(
"This test fail in DEBUG_MODE but this don't make theano generate some bad code. It is a trouble in DEBUG_MODE") isinstance(get_default_mode(),theano.compile.debugmode.DebugMode),
("This test fails in DEBUG_MODE, but the generated code is OK. "
"It is actually a problem of DEBUG_MODE, see #626."))
def test_default(): def test_default():
x, y = scalars('xy') x, y = scalars('xy')
z = default(x, y) z = default(x, y)
...@@ -3319,8 +3325,10 @@ def test_default(): ...@@ -3319,8 +3325,10 @@ def test_default():
assert f(None, 2) == 2 assert f(None, 2) == 2
assert f(1, None) == 1 assert f(1, None) == 1
@dec.knownfailureif(isinstance(get_default_mode(),theano.compile.debugmode.DebugMode), @dec.knownfailureif(
"This test fail in DEBUG_MODE but this don't make theano generate some bad code. It is a trouble in DEBUG_MODE") isinstance(get_default_mode(),theano.compile.debugmode.DebugMode),
("This test fails in DEBUG_MODE, but the generated code is OK. "
"It is actually a problem of DEBUG_MODE, see #626."))
def test_default_state(): def test_default_state():
x, y = scalars('xy') x, y = scalars('xy')
print config.floatX print config.floatX
......
...@@ -549,13 +549,13 @@ def test_inplace0(): ...@@ -549,13 +549,13 @@ def test_inplace0():
raise Failure('gemm_inplace in graph') raise Failure('gemm_inplace in graph')
assert _dot22 in [n.op for n in f.maker.env.nodes] assert _dot22 in [n.op for n in f.maker.env.nodes]
raise KnownFailureTest("gemm not always inserted")
f = inplace_func([X,Y,Z,a,b, R, S, c], f = inplace_func([X,Y,Z,a,b, R, S, c],
[Z * (c*Z + a * T.dot(X,Y) + b * T.dot(R,S).T)], mode='FAST_RUN') [Z * (c*Z + a * T.dot(X,Y) + b * T.dot(R,S).T)], mode='FAST_RUN')
# gemm_inplace should be inserted here, to work in-place on Z*c # gemm_inplace should be inserted here, to work in-place on Z*c
if (not gemm_inplace in [n.op for n in f.maker.env.nodes]): if (not gemm_inplace in [n.op for n in f.maker.env.nodes]):
print pp(f.maker.env.outputs[0]) print pp(f.maker.env.outputs[0])
raise Failure('no gemm_inplace in graph') #raise Failure('no gemm_inplace in graph')
raise KnownFailureTest("gemm not always inserted, see #415")
def test_inplace1(): def test_inplace1():
X,Y,Z,a,b = XYZab() X,Y,Z,a,b = XYZab()
......
...@@ -55,7 +55,7 @@ class TestRealImag(unittest.TestCase): ...@@ -55,7 +55,7 @@ class TestRealImag(unittest.TestCase):
mval = numpy.asarray(rng.randn(2,5)) mval = numpy.asarray(rng.randn(2,5))
utt.verify_grad(f, [mval]) utt.verify_grad(f, [mval])
@dec.knownfailureif(True,"Complex grads not enabled") @dec.knownfailureif(True,"Complex grads not enabled, see #178")
def test_mul_mixed0(self): def test_mul_mixed0(self):
def f(a): def f(a):
...@@ -71,7 +71,7 @@ class TestRealImag(unittest.TestCase): ...@@ -71,7 +71,7 @@ class TestRealImag(unittest.TestCase):
print e.analytic_grad print e.analytic_grad
raise raise
@dec.knownfailureif(True,"Complex grads not enabled") @dec.knownfailureif(True,"Complex grads not enabled, see #178")
def test_mul_mixed1(self): def test_mul_mixed1(self):
def f(a): def f(a):
...@@ -86,7 +86,7 @@ class TestRealImag(unittest.TestCase): ...@@ -86,7 +86,7 @@ class TestRealImag(unittest.TestCase):
print e.num_grad.gf print e.num_grad.gf
print e.analytic_grad print e.analytic_grad
raise raise
@dec.knownfailureif(True,"Complex grads not enabled") @dec.knownfailureif(True,"Complex grads not enabled, see #178")
def test_mul_mixed(self): def test_mul_mixed(self):
def f(a,b): def f(a,b):
......
...@@ -1136,7 +1136,8 @@ def test_log_add(): ...@@ -1136,7 +1136,8 @@ def test_log_add():
print f([10000], [10000]) # causes overflow if handled incorrectly print f([10000], [10000]) # causes overflow if handled incorrectly
assert numpy.allclose(f([10000], [10000]), 20000) assert numpy.allclose(f([10000], [10000]), 20000)
except AssertionError: except AssertionError:
raise KnownFailureTest raise KnownFailureTest(('log(add(exp)) is not stabilized when adding '
'more than 2 elements, see #623'))
#TODO: test that the optimization works in the presence of broadcasting. #TODO: test that the optimization works in the presence of broadcasting.
...@@ -1710,19 +1711,25 @@ def test_constant_get_stabilized(): ...@@ -1710,19 +1711,25 @@ def test_constant_get_stabilized():
x2 = T.scalar() x2 = T.scalar()
y2 = T.log(1+T.exp(x2)) y2 = T.log(1+T.exp(x2))
f2 = theano.function([x2],y2) f2 = theano.function([x2],y2)
raise KnownFailureTest("Theano optimize constant before stabilization! This break stabilization optimization is some case!") try:
assert len(f2.maker.env.toposort())==1 assert len(f2.maker.env.toposort())==1
assert f2.maker.env.toposort()[0].op==theano.tensor.nnet.sigm.softplus assert f2.maker.env.toposort()[0].op==theano.tensor.nnet.sigm.softplus
assert f2(800)==800 assert f2(800)==800
x = T.as_tensor_variable(800) x = T.as_tensor_variable(800)
y = T.log(1+T.exp(x)) y = T.log(1+T.exp(x))
f = theano.function([],y) f = theano.function([],y)
assert len(f.maker.env.toposort())==0 assert len(f.maker.env.toposort())==0
assert numpy.isinf(f()) assert numpy.isinf(f())
#When this error is fixed, the following line should be ok. #When this error is fixed, the following line should be ok.
assert f()==800,f() assert f()==800,f()
except (AssertionError, theano.compile.debugmode.InvalidValueError):
raise KnownFailureTest((
"Theano optimizes constant before stabilization. "
"This breaks stabilization optimization in some cases. See #504."))
class T_local_switch_sink(unittest.TestCase): class T_local_switch_sink(unittest.TestCase):
def setUp(self): def setUp(self):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论