提交 ca3b7032 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Skipping some GPU-related tests when cuda_ndarray is not available

上级 996d48b1
...@@ -5,8 +5,14 @@ from theano import tensor ...@@ -5,8 +5,14 @@ from theano import tensor
import numpy import numpy
# Skip test if cuda_ndarray is not available.
from nose.plugins.skip import SkipTest
try:
import cuda_ndarray
except ImportError:
raise SkipTest('Optional package cuda_ndarray not available')
import theano.sandbox.cuda as tcn import theano.sandbox.cuda as tcn
import cuda_ndarray
def tes_use(): def tes_use():
tcn.use() tcn.use()
......
...@@ -267,6 +267,12 @@ def test_bench_elemwise(n_iter=1000, **kwargs): ...@@ -267,6 +267,12 @@ def test_bench_elemwise(n_iter=1000, **kwargs):
setattr(conf, k, kwargs[k]) setattr(conf, k, kwargs[k])
if conf.use_gpu: if conf.use_gpu:
# Skip test if cuda_ndarray is not available.
from nose.plugins.skip import SkipTest
try:
import cuda_ndarray
except ImportError:
raise SkipTest('Optional package cuda_ndarray not available')
import theano.sandbox.cuda import theano.sandbox.cuda
theano.sandbox.cuda.use() theano.sandbox.cuda.use()
......
...@@ -5,6 +5,13 @@ from theano import tensor ...@@ -5,6 +5,13 @@ from theano import tensor
import numpy import numpy
# Skip test if cuda_ndarray is not available.
from nose.plugins.skip import SkipTest
try:
import cuda_ndarray
except ImportError:
raise SkipTest('Optional package cuda_ndarray not available')
import theano.sandbox.cuda as tcn import theano.sandbox.cuda as tcn
from theano.sandbox.downsample import DownsampleFactorMax from theano.sandbox.downsample import DownsampleFactorMax
......
...@@ -11,6 +11,13 @@ import theano.sandbox.downsample ...@@ -11,6 +11,13 @@ import theano.sandbox.downsample
import numpy import numpy
# Skip test if cuda_ndarray is not available.
from nose.plugins.skip import SkipTest
try:
import cuda_ndarray
except ImportError:
raise SkipTest('Optional package cuda_ndarray not available')
import theano.sandbox.cuda as tcn import theano.sandbox.cuda as tcn
import logging import logging
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论