提交 87d521fb authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron 提交者: slefrancois

Fix the context code to not create a new context.

上级 0dd6a0b7
...@@ -14,24 +14,15 @@ from nose.plugins.skip import SkipTest ...@@ -14,24 +14,15 @@ from nose.plugins.skip import SkipTest
from nose.tools import assert_raises from nose.tools import assert_raises
import numpy import numpy
import theano.gpuarray
from theano.compat import PY3 from theano.compat import PY3
from theano import config from theano import config
from theano.misc.pkl_utils import CompatUnpickler from theano.misc.pkl_utils import CompatUnpickler
if not theano.gpuarray.pygpu_activated: try:
try: from . import config # noqa
import pygpu have_pygpu = True
except ImportError: except SkipTest:
pygpu = None have_pygpu = False
import theano.sandbox.cuda as cuda_ndarray
if pygpu and cuda_ndarray.cuda_available:
cuda_ndarray.use('gpu', default_to_move_computation_to_gpu=False,
move_shared_float32_to_gpu=False,
enable_cuda=False)
theano.gpuarray.init_dev('cuda')
from .. import pygpu_activated # noqa
def test_unpickle_gpuarray_as_numpy_ndarray_flag1(): def test_unpickle_gpuarray_as_numpy_ndarray_flag1():
...@@ -40,8 +31,8 @@ def test_unpickle_gpuarray_as_numpy_ndarray_flag1(): ...@@ -40,8 +31,8 @@ def test_unpickle_gpuarray_as_numpy_ndarray_flag1():
test_type.py test it when pygpu is there. test_type.py test it when pygpu is there.
""" """
if pygpu_activated: if have_pygpu:
raise SkipTest("pygpu disabled") raise SkipTest("pygpu active")
oldflag = config.experimental.unpickle_gpu_on_cpu oldflag = config.experimental.unpickle_gpu_on_cpu
config.experimental.unpickle_gpu_on_cpu = False config.experimental.unpickle_gpu_on_cpu = False
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论