提交 2e4f6ea3 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Make sure the gpu part is only tested when we are actually running on a GPU.

上级 0faf7819
...@@ -2,7 +2,7 @@ import numpy ...@@ -2,7 +2,7 @@ import numpy
from nose.plugins.skip import SkipTest from nose.plugins.skip import SkipTest
from theano.sandbox.cuda.var import float32_shared_constructor as f32sc from theano.sandbox.cuda.var import float32_shared_constructor as f32sc
from theano.sandbox.cuda import CudaNdarrayType, cuda_available from theano.sandbox.cuda import CudaNdarrayType, cuda_available, cuda_enabled
import theano import theano
...@@ -17,6 +17,7 @@ def test_shared_pickle(): ...@@ -17,6 +17,7 @@ def test_shared_pickle():
v = numpy.array([1.0, 2.0], dtype='float32') v = numpy.array([1.0, 2.0], dtype='float32')
# This test will always be on the GPU # This test will always be on the GPU
if cuda_enabled:
assert isinstance(g, theano.tensor.basic.TensorVariable) assert isinstance(g, theano.tensor.basic.TensorVariable)
assert isinstance(g.owner, theano.gof.graph.Apply) assert isinstance(g.owner, theano.gof.graph.Apply)
assert isinstance(g.owner.op, theano.sandbox.cuda.HostFromGpu) assert isinstance(g.owner.op, theano.sandbox.cuda.HostFromGpu)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论