提交 27135a7d authored 作者: Frederic's avatar Frederic

make theano.sandbox.cuda import work when there is no pycuda or scikits.cuda

上级 b7bcc91a
...@@ -6,17 +6,20 @@ import theano.tensor as T ...@@ -6,17 +6,20 @@ import theano.tensor as T
from theano.sandbox.cuda import (GpuOp, basic_ops, CudaNdarrayType, from theano.sandbox.cuda import (GpuOp, basic_ops, CudaNdarrayType,
CudaNdarray) CudaNdarray)
import scikits.cuda
from scikits.cuda import fft, cublas, misc
import pycuda.gpuarray
import theano.misc.pycuda_init import theano.misc.pycuda_init
from theano.misc.pycuda_init import pycuda_available
if pycuda_available:
import pycuda.gpuarray
try:
import scikits.cuda
from scikits.cuda import fft, cublas
scikits.cuda.misc.init()
scikits_cuda_available = True
except ImportError:
scikits_cuda_available = False
misc.init()
# TODO: investigate the effect of enabling fastmath on FFT performance # TODO: investigate the effect of enabling fastmath on FFT performance
# (how can it be enabled?). # (how can it be enabled?).
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论