提交 610f6770 authored 作者: Thomas George's avatar Thomas George

added test to fix import error when cuda is not available

上级 2de2d1ab
...@@ -3,10 +3,13 @@ from __future__ import absolute_import, division, print_function ...@@ -3,10 +3,13 @@ from __future__ import absolute_import, division, print_function
import pkg_resources import pkg_resources
import theano import theano
from theano.sandbox.cuda import CudaNdarray, GpuOp from theano.sandbox.cuda import GpuOp, cuda_available
from theano.sandbox.cuda.basic_ops import as_cuda_ndarray_variable from theano.sandbox.cuda.basic_ops import as_cuda_ndarray_variable
from theano.sandbox.cuda.type import CudaNdarrayType from theano.sandbox.cuda.type import CudaNdarrayType
if cuda_available:
from theano.sandbox.cuda import CudaNdarray
try: try:
from theano.sandbox.cuda import cuda_ndarray from theano.sandbox.cuda import cuda_ndarray
dimshuffle = cuda_ndarray.cuda_ndarray.dimshuffle dimshuffle = cuda_ndarray.cuda_ndarray.dimshuffle
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论