Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
c3f6a4c5
提交
c3f6a4c5
authored
6月 08, 2015
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[MAIN]Remove python 3 version of pickled file and use the good unpickler instead.
上级
c75f7892
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
16 行增加
和
10 行删除
+16
-10
pkl_utils.py
theano/misc/pkl_utils.py
+3
-3
CudaNdarray_py3.pkl
theano/sandbox/cuda/tests/CudaNdarray_py3.pkl
+0
-0
test_type.py
theano/sandbox/cuda/tests/test_type.py
+13
-7
没有找到文件。
theano/misc/pkl_utils.py
浏览文件 @
c3f6a4c5
...
@@ -96,9 +96,9 @@ def load_reduce(self):
...
@@ -96,9 +96,9 @@ def load_reduce(self):
except
Exception
:
except
Exception
:
pass
pass
if
self
.
is_verbose
:
#
if self.is_verbose:
print
(
sys
.
exc_info
())
#
print(sys.exc_info())
print
(
func
,
args
)
#
print(func, args)
raise
raise
...
...
theano/sandbox/cuda/tests/CudaNdarray_py3.pkl
deleted
100644 → 0
浏览文件 @
c75f7892
File deleted
theano/sandbox/cuda/tests/test_type.py
浏览文件 @
c3f6a4c5
...
@@ -6,6 +6,8 @@ from nose.tools import assert_raises
...
@@ -6,6 +6,8 @@ from nose.tools import assert_raises
import
numpy
import
numpy
from
theano
import
config
from
theano
import
config
from
theano.compat
import
PY3
from
theano.misc.pkl_utils
import
CompatUnpickler
from
theano.sandbox.cuda
import
cuda_available
from
theano.sandbox.cuda
import
cuda_available
if
cuda_available
:
if
cuda_available
:
...
@@ -30,16 +32,18 @@ def test_unpickle_cudandarray_as_numpy_ndarray_flag0():
...
@@ -30,16 +32,18 @@ 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__
))
fname
=
'CudaNdarray.pkl'
fname
=
'CudaNdarray.pkl'
if
sys
.
version_info
[
0
]
==
3
:
fname
=
'CudaNdarray_py3.pkl'
with
open
(
os
.
path
.
join
(
testfile_dir
,
fname
),
'rb'
)
as
fp
:
with
open
(
os
.
path
.
join
(
testfile_dir
,
fname
),
'rb'
)
as
fp
:
if
PY3
:
u
=
CompatUnpickler
(
fp
,
encoding
=
"latin1"
)
else
:
u
=
CompatUnpickler
(
fp
)
if
cuda_available
:
if
cuda_available
:
mat
=
cPickle
.
load
(
fp
)
mat
=
u
.
load
(
)
assert
isinstance
(
mat
,
CudaNdarray
)
assert
isinstance
(
mat
,
CudaNdarray
)
assert
numpy
.
asarray
(
mat
)[
0
]
==
-
42.0
assert
numpy
.
asarray
(
mat
)[
0
]
==
-
42.0
else
:
else
:
assert_raises
(
ImportError
,
cPickle
.
load
,
fp
)
assert_raises
(
ImportError
,
u
.
load
)
finally
:
finally
:
config
.
experimental
.
unpickle_gpu_on_cpu
=
oldflag
config
.
experimental
.
unpickle_gpu_on_cpu
=
oldflag
...
@@ -52,11 +56,13 @@ def test_unpickle_cudandarray_as_numpy_ndarray_flag1():
...
@@ -52,11 +56,13 @@ def test_unpickle_cudandarray_as_numpy_ndarray_flag1():
try
:
try
:
testfile_dir
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
testfile_dir
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
fname
=
'CudaNdarray.pkl'
fname
=
'CudaNdarray.pkl'
if
sys
.
version_info
[
0
]
==
3
:
fname
=
'CudaNdarray_py3.pkl'
with
open
(
os
.
path
.
join
(
testfile_dir
,
fname
),
'rb'
)
as
fp
:
with
open
(
os
.
path
.
join
(
testfile_dir
,
fname
),
'rb'
)
as
fp
:
mat
=
cPickle
.
load
(
fp
)
if
PY3
:
u
=
CompatUnpickler
(
fp
,
encoding
=
"latin1"
)
else
:
u
=
CompatUnpickler
(
fp
)
mat
=
u
.
load
()
assert
isinstance
(
mat
,
numpy
.
ndarray
)
assert
isinstance
(
mat
,
numpy
.
ndarray
)
assert
mat
[
0
]
==
-
42.0
assert
mat
[
0
]
==
-
42.0
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论