提交 d6e5dc8c authored 作者: Frederic's avatar Frederic

[CRASH] due to import order when using DebugMode on the GPU.

上级 a30feb9c
...@@ -81,6 +81,16 @@ from theano.updates import Updates, OrderedUpdates ...@@ -81,6 +81,16 @@ from theano.updates import Updates, OrderedUpdates
from theano.gradient import Rop, Lop, grad, subgraph_grad from theano.gradient import Rop, Lop, grad, subgraph_grad
# This need to be before the init of GPU, as it add config variable
# needed during that phase.
import theano.tests
if hasattr(theano.tests, "TheanoNoseTester"):
test = theano.tests.TheanoNoseTester().test
else:
def test():
raise ImportError("The nose module is not installed."
" It is needed for Theano tests.")
if config.device.startswith('gpu') or config.init_gpu_device.startswith('gpu'): if config.device.startswith('gpu') or config.init_gpu_device.startswith('gpu'):
import theano.sandbox.cuda import theano.sandbox.cuda
# We can't test the driver during import of theano.sandbox.cuda as # We can't test the driver during import of theano.sandbox.cuda as
...@@ -185,15 +195,6 @@ def sparse_grad(var): ...@@ -185,15 +195,6 @@ def sparse_grad(var):
ret = var.owner.op.__class__(sparse_grad=True)(*var.owner.inputs) ret = var.owner.op.__class__(sparse_grad=True)(*var.owner.inputs)
return ret return ret
import theano.tests
if hasattr(theano.tests, "TheanoNoseTester"):
test = theano.tests.TheanoNoseTester().test
else:
def test():
raise ImportError("The nose module is not installed."
" It is needed for Theano tests.")
# This cannot be done in tensor/__init__.py due to a circular dependency -- randomstreams # This cannot be done in tensor/__init__.py due to a circular dependency -- randomstreams
# depends on raw_random which depends on tensor. As a work-around, we import RandomStreams # depends on raw_random which depends on tensor. As a work-around, we import RandomStreams
# here and inject an instance in tensor. # here and inject an instance in tensor.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论