Skip to content

Commit

Permalink
Catch exception by Theano 0.10+ on importing theano.sandbox.cuda
Browse files Browse the repository at this point in the history
  • Loading branch information
f0k committed Feb 21, 2018
1 parent 8978b1d commit 0334f76
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lasagne/layers/corrmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
if not gpu_enabled:
try:
from theano.sandbox import cuda as gpu
except ImportError:
except Exception: # Theano 0.10+ raises nose.SkipTest
gpu_enabled = False
else:
gpu_enabled = gpu.cuda_enabled
Expand Down
2 changes: 1 addition & 1 deletion lasagne/layers/dnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
try:
from theano.sandbox import cuda as gpu
import theano.sandbox.cuda.dnn
except ImportError:
except Exception: # Theano 0.10+ raises nose.SkipTest
gpu_enabled = False
else:
gpu_enabled = gpu.cuda_enabled
Expand Down
2 changes: 1 addition & 1 deletion lasagne/tests/layers/test_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from theano.sandbox import cuda
theano_backend = "cuda_sandbox"
gpu = cuda.cuda_enabled
except ImportError:
except Exception: # Theano 0.10+ raises nose.SkipTest
gpu = False
if not gpu:
theano_backend = "cpu"
Expand Down

0 comments on commit 0334f76

Please sign in to comment.