提交 2caf8e20 authored 作者: Frederic's avatar Frederic

Don't duplicate code, reuse it.

上级 7dd20e1d
...@@ -11,16 +11,8 @@ from theano.sandbox import gpuarray ...@@ -11,16 +11,8 @@ from theano.sandbox import gpuarray
if theano.sandbox.gpuarray.pygpu is None: if theano.sandbox.gpuarray.pygpu is None:
raise SkipTest("pygpu not installed") raise SkipTest("pygpu not installed")
import theano.sandbox.cuda as cuda_ndarray # We let that import do the init of the back-end if needed.
if cuda_ndarray.cuda_available and not theano.sandbox.gpuarray.pygpu_activated: import theano.sandbox.gpuarray.tests.test_basic_ops
if not cuda_ndarray.use.device_number:
#We should not enable all the use like the flag device=gpu,
#as many tests don't work in that setup.
cuda_ndarray.use('gpu',
default_to_move_computation_to_gpu=False,
move_shared_float32_to_gpu=False,
enable_cuda=False)
gpuarray.init_dev('cuda')
if not gpuarray.pygpu_activated: if not gpuarray.pygpu_activated:
raise SkipTest("pygpu disabled") raise SkipTest("pygpu disabled")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论