Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
f126e2a0
提交
f126e2a0
authored
10月 04, 2013
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make theano-cache cleanup remove from the cache module with old version of c code.
上级
f2d653a8
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
20 行增加
和
5 行删除
+20
-5
theano-cache
bin/theano-cache
+1
-1
compiledir.py
theano/gof/compiledir.py
+19
-4
没有找到文件。
bin/theano-cache
浏览文件 @
f126e2a0
...
...
@@ -19,7 +19,7 @@ def print_help(exit_status):
print
'Type "theano-cache clear" to erase the cache'
print
'Type "theano-cache list" to print the cache content'
print
'Type "theano-cache unlock" to unlock the cache directory'
print
'Type "theano-cache cleanup" to delete keys in the old format'
print
'Type "theano-cache cleanup" to delete keys in the old format
/code version
'
print
'Type "theano-cache purge" to force deletion of the cache directory'
print
(
'Type "theano-cache basecompiledir" '
'to print the parent of the cache directory'
)
...
...
theano/gof/compiledir.py
浏览文件 @
f126e2a0
...
...
@@ -181,7 +181,7 @@ def cleanup():
"""
Delete keys in old format from the compiledir.
Old clean up include key in old format:
Old clean up include key in old format
or with old version of the c_code
:
1) keys that have an ndarray in them.
Now we use a hash in the keys of the constant data.
2) key that don't have the numpy ABI version in them
...
...
@@ -204,16 +204,30 @@ def cleanup():
have_c_compiler
=
False
for
obj
in
flatten
(
key
):
if
isinstance
(
obj
,
numpy
.
ndarray
):
keydata
.
remove_key
(
key
)
have_npy_abi_version
=
False
break
elif
isinstance
(
obj
,
basestring
):
if
obj
.
startswith
(
'NPY_ABI_VERSION=0x'
):
have_npy_abi_version
=
True
elif
obj
.
startswith
(
'c_compiler_str='
):
have_c_compiler
=
True
elif
(
isinstance
(
obj
,
(
theano
.
gof
.
Op
,
theano
.
gof
.
Type
))
and
hasattr
(
obj
,
'c_code_cache_version'
)):
v
=
obj
.
c_code_cache_version
()
if
v
not
in
[(),
None
]
and
v
not
in
key
[
0
]:
have_npy_abi_version
=
False
break
if
not
have_npy_abi_version
or
not
have_c_compiler
:
keydata
.
remove_key
(
key
)
try
:
#This can happen when we move the compiledir.
if
keydata
.
key_pkl
!=
filename
:
keydata
.
key_pkl
=
filename
keydata
.
remove_key
(
key
)
except
IOError
,
e
:
print
(
"ERROR while removing a key entry"
" from file. '
%
s'."
" Delete its directory"
%
filename
)
if
len
(
keydata
.
keys
)
==
0
:
shutil
.
rmtree
(
os
.
path
.
join
(
compiledir
,
directory
))
...
...
@@ -221,7 +235,8 @@ def cleanup():
print
(
"ERROR while reading this key file '
%
s'."
" Delete its directory"
%
filename
)
except
IOError
:
pass
print
(
"ERROR while cleaning up this directory '
%
s'."
" Delete it."
%
directory
)
finally
:
if
file
is
not
None
:
file
.
close
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论