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

Merge pull request #4210 from fvisin/fix_docgen_cuda

Fix docgen fails due to GPU not available
...@@ -28,7 +28,7 @@ if (not hasattr(theano.sandbox, 'cuda') or ...@@ -28,7 +28,7 @@ if (not hasattr(theano.sandbox, 'cuda') or
import pycuda import pycuda
import pycuda.autoinit import pycuda.autoinit
pycuda_available = True pycuda_available = True
except ImportError: except (ImportError, RuntimeError):
# presumably, the user wanted to use pycuda, else they wouldn't have # presumably, the user wanted to use pycuda, else they wouldn't have
# imported this module, so issue a warning that the import failed. # imported this module, so issue a warning that the import failed.
warnings.warn("PyCUDA import failed in theano.misc.pycuda_init") warnings.warn("PyCUDA import failed in theano.misc.pycuda_init")
......
...@@ -6,11 +6,11 @@ import theano.tensor as T ...@@ -6,11 +6,11 @@ import theano.tensor as T
from theano.sandbox.cuda import cuda_available, GpuOp from theano.sandbox.cuda import cuda_available, GpuOp
from theano.ifelse import ifelse from theano.ifelse import ifelse
from theano.misc.pycuda_init import pycuda_available
if cuda_available: if cuda_available:
from theano.sandbox.cuda import (basic_ops, CudaNdarrayType, from theano.sandbox.cuda import (basic_ops, CudaNdarrayType,
CudaNdarray) CudaNdarray)
from theano.misc.pycuda_init import pycuda_available
if pycuda_available: if pycuda_available:
import pycuda.gpuarray import pycuda.gpuarray
...@@ -19,7 +19,7 @@ try: ...@@ -19,7 +19,7 @@ try:
from scikits.cuda import fft, cublas from scikits.cuda import fft, cublas
scikits.cuda.misc.init() scikits.cuda.misc.init()
scikits_cuda_available = True scikits_cuda_available = True
except ImportError: except (ImportError, Exception):
scikits_cuda_available = False scikits_cuda_available = False
...@@ -363,7 +363,7 @@ def mult_and_reduce(input_fft_v, filters_fft_v, input_shape=None, ...@@ -363,7 +363,7 @@ def mult_and_reduce(input_fft_v, filters_fft_v, input_shape=None,
Parameters Parameters
---------- ----------
input_fft_v input_fft_v
It's (b, ic, i0, i1//2 + 1, 2). It's (b, ic, i0, i1//2 + 1, 2).
filters_fft_v filters_fft_v
It's (oc, ic, i0, i1//2 + 1, 2). It's (oc, ic, i0, i1//2 + 1, 2).
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论