提交 9b8a8a4f authored 作者: Frederic's avatar Frederic

Fix test in python 3.

This is related to the unpickle problem of ndarray.
上级 ab720fb5
import cPickle import cPickle
import os.path
import sys
from nose.tools import assert_raises from nose.tools import assert_raises
import numpy import numpy
import os.path
from theano import config from theano import config
from theano.sandbox.cuda import cuda_available from theano.sandbox.cuda import cuda_available
...@@ -23,7 +26,11 @@ def test_unpickle_cudandarray_as_numpy_ndarray_flag0(): ...@@ -23,7 +26,11 @@ def test_unpickle_cudandarray_as_numpy_ndarray_flag0():
try: try:
testfile_dir = os.path.dirname(os.path.realpath(__file__)) testfile_dir = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(testfile_dir, 'CudaNdarray.pkl')) as fp: fname = 'CudaNdarray.pkl'
if sys.version_info.major == 3:
fname = 'CudaNdarray_py3.pkl'
with open(os.path.join(testfile_dir, fname), 'rb') as fp:
if cuda_available: if cuda_available:
mat = cPickle.load(fp) mat = cPickle.load(fp)
else: else:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论