提交 0d20ed2e authored 作者: Frederic Bastien's avatar Frederic Bastien

skip test if cuda not installed

上级 0dae8f43
...@@ -10,9 +10,8 @@ import theano.tensor as T ...@@ -10,9 +10,8 @@ import theano.tensor as T
# Skip test if cuda_ndarray is not available. # Skip test if cuda_ndarray is not available.
from nose.plugins.skip import SkipTest from nose.plugins.skip import SkipTest
try: import theano.sandbox.cuda as cuda_ndarray
import theano.sandbox.cuda as cuda_ndarray if cuda_ndarray.enable_cuda == False:
except ImportError:
raise SkipTest('Optional package cuda_ndarray not available') raise SkipTest('Optional package cuda_ndarray not available')
import theano.sandbox.cuda as tcn import theano.sandbox.cuda as tcn
......
...@@ -269,9 +269,8 @@ def test_bench_elemwise(n_iter=1000, **kwargs): ...@@ -269,9 +269,8 @@ def test_bench_elemwise(n_iter=1000, **kwargs):
if conf.use_gpu: if conf.use_gpu:
# Skip test if cuda_ndarray is not available. # Skip test if cuda_ndarray is not available.
from nose.plugins.skip import SkipTest from nose.plugins.skip import SkipTest
try: import theano.sandbox.cuda as cuda_ndarray
import cuda_ndarray if cuda_ndarray.enable_cuda == False:
except ImportError:
raise SkipTest('Optional package cuda_ndarray not available') raise SkipTest('Optional package cuda_ndarray not available')
import theano.sandbox.cuda import theano.sandbox.cuda
theano.sandbox.cuda.use() theano.sandbox.cuda.use()
......
...@@ -7,9 +7,8 @@ import numpy ...@@ -7,9 +7,8 @@ import numpy
# Skip test if cuda_ndarray is not available. # Skip test if cuda_ndarray is not available.
from nose.plugins.skip import SkipTest from nose.plugins.skip import SkipTest
try: import theano.sandbox.cuda as cuda_ndarray
import theano.sandbox.cuda as cuda_ndarray if cuda_ndarray.enable_cuda == False:
except ImportError:
raise SkipTest('Optional package cuda_ndarray not available') raise SkipTest('Optional package cuda_ndarray not available')
import theano.sandbox.cuda as tcn import theano.sandbox.cuda as tcn
......
import sys, time import sys, time
import numpy import numpy
# Skip test if cuda_ndarray is not available.
from nose.plugins.skip import SkipTest
import theano.sandbox.cuda as cuda_ndarray import theano.sandbox.cuda as cuda_ndarray
if cuda_ndarray.enable_cuda == False:
raise SkipTest('Optional package cuda_ndarray not available')
def py_conv_valid_numpy(img, kern): def py_conv_valid_numpy(img, kern):
assert img.shape[1] == kern.shape[1] assert img.shape[1] == kern.shape[1]
......
import time, copy, sys import time, copy, sys
import theano.sandbox.cuda as cuda_ndarray import theano.sandbox.cuda as cuda_ndarray
# Skip test if cuda_ndarray is not available.
from nose.plugins.skip import SkipTest
if cuda_ndarray.enable_cuda == False:
raise SkipTest('Optional package cuda_ndarray not available')
import numpy import numpy
def test_host_to_device(): def test_host_to_device():
......
...@@ -13,9 +13,8 @@ import numpy ...@@ -13,9 +13,8 @@ import numpy
# Skip test if cuda_ndarray is not available. # Skip test if cuda_ndarray is not available.
from nose.plugins.skip import SkipTest from nose.plugins.skip import SkipTest
try: import theano.sandbox.cuda as cuda_ndarray
import theano.sandbox.cuda as cuda_ndarray if cuda_ndarray.enable_cuda == False:
except ImportError:
raise SkipTest('Optional package cuda_ndarray not available') raise SkipTest('Optional package cuda_ndarray not available')
import theano.sandbox.cuda as tcn import theano.sandbox.cuda as tcn
......
...@@ -7,9 +7,8 @@ import numpy ...@@ -7,9 +7,8 @@ import numpy
# Skip test if cuda_ndarray is not available. # Skip test if cuda_ndarray is not available.
from nose.plugins.skip import SkipTest from nose.plugins.skip import SkipTest
try: import theano.sandbox.cuda as cuda_ndarray
import theano.sandbox.cuda as cuda_ndarray if cuda_ndarray.enable_cuda == False:
except ImportError:
raise SkipTest('Optional package cuda_ndarray not available') raise SkipTest('Optional package cuda_ndarray not available')
import theano.compile.mode import theano.compile.mode
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论