提交 16b5fd82 authored 作者: abergeron's avatar abergeron

Merge pull request #1752 from nouiz/py3

Fix test in python 3.
import cPickle
import os.path
import sys
from nose.tools import assert_raises
import numpy
import os.path
from theano import config
from theano.sandbox.cuda import cuda_available
......@@ -26,7 +29,11 @@ def test_unpickle_cudandarray_as_numpy_ndarray_flag0():
try:
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:
mat = cPickle.load(fp)
else:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论