提交 0a626acf authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Fix small errors following review and make make_vector_op an instance too.

上级 6a936ae7
...@@ -956,7 +956,7 @@ class T_Join_and_Split(theano.tensor.tests.test_basic.T_Join_and_Split): ...@@ -956,7 +956,7 @@ class T_Join_and_Split(theano.tensor.tests.test_basic.T_Join_and_Split):
# No gpu split. # No gpu split.
self.split_op = tensor.Split self.split_op = tensor.Split
# No Make vector on the gpu, Join used instead # No Make vector on the gpu, Join used instead
self.make_vector_op = cuda.GpuJoin self.make_vector_op = cuda.GpuJoin()
self.floatX = "float32" self.floatX = "float32"
# In FAST_COMPILE mode, we force the FAST_RUN mode for optimization. # In FAST_COMPILE mode, we force the FAST_RUN mode for optimization.
self.hide_error = theano.config.mode not in ['DebugMode', 'DEBUG_MODE'] self.hide_error = theano.config.mode not in ['DebugMode', 'DEBUG_MODE']
......
...@@ -305,7 +305,7 @@ class TestAlloc(theano.tensor.tests.test_basic.TestAlloc): ...@@ -305,7 +305,7 @@ class TestAlloc(theano.tensor.tests.test_basic.TestAlloc):
dtype = "float32" dtype = "float32"
mode = mode_with_gpu mode = mode_with_gpu
shared = staticmethod(gpuarray_shared_constructor) shared = staticmethod(gpuarray_shared_constructor)
allocs = [GpuAlloc(), GpuAlloc(), T.Alloc] allocs = [GpuAlloc(), GpuAlloc(), T.Alloc()]
def test_shape(): def test_shape():
...@@ -366,7 +366,7 @@ class G_Join_and_Split(test_basic.T_Join_and_Split): ...@@ -366,7 +366,7 @@ class G_Join_and_Split(test_basic.T_Join_and_Split):
self.join_op = GpuJoin() self.join_op = GpuJoin()
self.split_op = GpuSplit self.split_op = GpuSplit
# Use join instead of MakeVector since there is no MakeVector on GPU # Use join instead of MakeVector since there is no MakeVector on GPU
self.make_vector_op = GpuJoin self.make_vector_op = GpuJoin()
# this is to avoid errors with limited devices # this is to avoid errors with limited devices
self.floatX = 'float32' self.floatX = 'float32'
self.hide_error = theano.config.mode not in ['DebugMode', 'DEBUG_MODE'] self.hide_error = theano.config.mode not in ['DebugMode', 'DEBUG_MODE']
......
...@@ -3194,7 +3194,7 @@ class T_Join_and_Split(unittest.TestCase): ...@@ -3194,7 +3194,7 @@ class T_Join_and_Split(unittest.TestCase):
) )
self.join_op = Join() self.join_op = Join()
self.split_op = Split self.split_op = Split
self.make_vector_op = opt.MakeVector self.make_vector_op = opt.MakeVector()
self.floatX = config.floatX self.floatX = config.floatX
self.hide_error = theano.config.mode not in ['DebugMode', self.hide_error = theano.config.mode not in ['DebugMode',
'DEBUG_MODE', 'DEBUG_MODE',
...@@ -3217,7 +3217,8 @@ class T_Join_and_Split(unittest.TestCase): ...@@ -3217,7 +3217,8 @@ class T_Join_and_Split(unittest.TestCase):
make_vector_op = self.make_vector_op make_vector_op = self.make_vector_op
f = theano.function([], outputs, self.mode) f = theano.function([], outputs, self.mode)
topo = f.maker.fgraph.toposort() topo = f.maker.fgraph.toposort()
assert [True for node in topo if isinstance(node.op, make_vector_op)] assert [True for node in topo
if isinstance(node.op, type(make_vector_op))]
variables = f() variables = f()
if isinstance(variables, (tuple, list)) and len(variables) == 1: if isinstance(variables, (tuple, list)) and len(variables) == 1:
return variables[0] return variables[0]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论