提交 5ef41524 authored 作者: Ian Goodfellow's avatar Ian Goodfellow

Added a KnownFailureTest--test_naacl09 depends on deprecated

compile.module
上级 1d23a748
...@@ -988,6 +988,8 @@ class TensorType(Type): ...@@ -988,6 +988,8 @@ class TensorType(Type):
%(type_num)s, type_num_%(name)s); %(type_num)s, type_num_%(name)s);
%(fail)s %(fail)s
} }
// This is a TypeError to be consistent with DEBUG_MODE
// Note: DEBUG_MODE also tells the name of the container
if (type_num_%(name)s != %(type_num)s) { if (type_num_%(name)s != %(type_num)s) {
PyErr_Format(PyExc_TypeError, PyErr_Format(PyExc_TypeError,
"expected type_num %%d (%(type_num)s) got %%d", "expected type_num %%d (%(type_num)s) got %%d",
......
...@@ -10,6 +10,7 @@ from theano import tensor as T, sparse as S ...@@ -10,6 +10,7 @@ from theano import tensor as T, sparse as S
import numpy as N import numpy as N
import sys import sys
from theano.tests import unittest_tools from theano.tests import unittest_tools
from numpy.testing.noseclasses import KnownFailureTest
def cross_entropy(target, output, axis=1): def cross_entropy(target, output, axis=1):
""" """
...@@ -569,7 +570,16 @@ def test_naacl_model(iters_per_unsup=3, iters_per_sup=3, ...@@ -569,7 +570,16 @@ def test_naacl_model(iters_per_unsup=3, iters_per_sup=3,
t = time.time() t = time.time()
for i in xrange(3): for i in xrange(3):
for j in xrange(iters_per_unsup): for j in xrange(iters_per_unsup):
m.pretraining_update(*inputs) try:
known_fail = False
m.pretraining_update(*inputs)
except ValueError:
known_fail = True
except TypeError:
known_fail = True
raise KnownFailureTest("Deprecated compile.module fails to "
"give a sensible warning when updates to a variable "
"have the wrong type")
s0, s1 = [str(j) for j in m.pretraining_update(*inputs)] s0, s1 = [str(j) for j in m.pretraining_update(*inputs)]
#print 'huh?', i, iters_per_unsup, iters_per_unsup * (i+1), s0, s1 #print 'huh?', i, iters_per_unsup, iters_per_unsup * (i+1), s0, s1
if iters_per_unsup == 3: if iters_per_unsup == 3:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论