提交 ac42ce74 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

Merge pull request #631 from nouiz/fix_tests

Fix tests Looks ok to me.
......@@ -770,6 +770,11 @@ class GpuConv(GpuOp):
verbose = self.verbose
sub = sub.copy()
max_threads_dim0 = self.max_threads_dim0
if max_threads_dim0 is None:
raise NotImplementedError("GpuConv.c_code should not be called "
"directly. It should be called by "
"make_thunk() that add some information "
"related to the selected GPU.")
sub.update(locals())
return """
//Mandatory args
......
......@@ -244,7 +244,7 @@ class SparseInferShapeTester(utt.InferShapeTester):
[sp.csr_matrix(random_lil((10, 40),
config.floatX, 3)),
numpy.random.randn(10, 40).astype(config.floatX)],
MulSD)
MulSD, excluding=["local_mul_s_d"])
def test_remove0(self):
x = SparseType('csr', dtype=config.floatX)()
......
......@@ -170,10 +170,15 @@ class InferShapeTester(unittest.TestCase):
# optimizations, if we don't want to enumerate them explicitly.
self.mode = theano.compile.get_default_mode().including("canonicalize")
def _compile_and_check(self, inputs, outputs, numeric_inputs, cls):
outputs_function = theano.function(inputs, outputs, mode=self.mode)
def _compile_and_check(self, inputs, outputs, numeric_inputs, cls,
excluding=None):
mode = self.mode
if excluding:
mode = mode.excluding(*excluding)
outputs_function = theano.function(inputs, outputs, mode=mode)
shapes_function = theano.function(inputs, [o.shape for o in outputs],
mode=self.mode)
mode=mode)
#theano.printing.debugprint(shapes_function)
# Check that the Op is removed from the compiled function.
topo_shape = shapes_function.maker.env.toposort()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论