提交 331943ad authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Skip the gpu tests if the gpu can't be initialized.

上级 e76d05d6
...@@ -8,9 +8,11 @@ if theano.gpuarray.pygpu is None: ...@@ -8,9 +8,11 @@ if theano.gpuarray.pygpu is None:
raise SkipTest("pygpu not installed") raise SkipTest("pygpu not installed")
if (not theano.gpuarray.pygpu_activated and if (not theano.gpuarray.pygpu_activated and
not theano.config.init_gpu_device.startswith('gpu') and
not theano.config.force_device): not theano.config.force_device):
theano.gpuarray.init_dev('cuda') try:
theano.gpuarray.init_dev('cuda')
except Exception:
pass
if not theano.gpuarray.pygpu_activated: if not theano.gpuarray.pygpu_activated:
raise SkipTest("pygpu disabled") raise SkipTest("pygpu disabled")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论