提交 d8daec45 authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #2277 from KarnUllrich/fix-cuda-import

Fixed dependencies for theano.sandbox.cuda import
...@@ -7,7 +7,9 @@ from theano.gof.type import CDataType ...@@ -7,7 +7,9 @@ from theano.gof.type import CDataType
from theano.compat import PY3 from theano.compat import PY3
from theano.tensor.nnet import SoftmaxGrad from theano.tensor.nnet import SoftmaxGrad
from theano.sandbox.cuda.type import CudaNdarrayType from theano.sandbox.cuda.type import CudaNdarrayType
from theano.sandbox.cuda import (GpuOp, cuda_available) from theano.sandbox.cuda import (GpuOp, cuda_available,
active_device_number,
device_properties)
from theano.sandbox.cuda.basic_ops import (as_cuda_ndarray_variable, from theano.sandbox.cuda.basic_ops import (as_cuda_ndarray_variable,
gpu_contiguous, HostFromGpu) gpu_contiguous, HostFromGpu)
from theano.sandbox.cuda.blas import (GpuConv, GpuDownsampleFactorMax, from theano.sandbox.cuda.blas import (GpuConv, GpuDownsampleFactorMax,
...@@ -20,8 +22,8 @@ from theano.sandbox.cuda.nvcc_compiler import NVCC_compiler ...@@ -20,8 +22,8 @@ from theano.sandbox.cuda.nvcc_compiler import NVCC_compiler
def dnn_available(): def dnn_available():
if dnn_available.avail is None: if dnn_available.avail is None:
dev = theano.sandbox.cuda.active_device_number() dev = active_device_number()
if theano.sandbox.cuda.device_properties(dev)['major'] < 3: if device_properties(dev)['major'] < 3:
dnn_available.msg = "Device not supported by cuDNN" dnn_available.msg = "Device not supported by cuDNN"
dnn_available.avail = False dnn_available.avail = False
else: else:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论