提交 9b2c2087 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Make sure we don't need to have pygpu installed to run theano.

上级 4a51ae52
......@@ -7,8 +7,11 @@ from theano.scalar import Scalar
from theano.gof.python25 import all, any
import pygpu
from pygpu import gpuarray, elemwise
try:
import pygpu
from pygpu import gpuarray, elemwise
except ImportError:
pass
from type import GpuArrayType
......
import numpy
from theano import Op, Apply, scalar
from pygpu.tools import ScalarArg, ArrayArg
from pygpu.elemwise import ElemwiseKernel
try:
from pygpu.tools import ScalarArg, ArrayArg
from pygpu.elemwise import ElemwiseKernel
except ImportError:
pass
from basic_ops import as_gpuarray_variable
from type import GpuArrayType
......
......@@ -8,12 +8,10 @@ from theano.compile import SharedVariable
# (it will not work though)
try:
import pygpu
except ImportError:
pygpu = None
if pygpu:
from pygpu import gpuarray
from pygpu.elemwise import compare, elemwise2
except ImportError:
pass
class GpuArrayType(Type):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论