Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
b9bfe165
提交
b9bfe165
authored
2月 25, 2015
作者:
carriepl
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2529 from nouiz/cache
Make sure to not delete empty folder when we do not have the lock
上级
a074ec4a
651f69d5
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
17 行增加
和
10 行删除
+17
-10
cmodule.py
theano/gof/cmodule.py
+16
-2
opt.py
theano/sandbox/cuda/opt.py
+1
-8
没有找到文件。
theano/gof/cmodule.py
浏览文件 @
b9bfe165
...
@@ -663,10 +663,16 @@ class ModuleCache(object):
...
@@ -663,10 +663,16 @@ class ModuleCache(object):
too_old_to_use
=
[]
too_old_to_use
=
[]
to_delete
=
[]
to_delete
=
[]
to_delete_empty
=
[]
def
rmtree
(
*
args
,
**
kwargs
):
def
rmtree
(
*
args
,
**
kwargs
):
if
cleanup
:
if
cleanup
:
to_delete
.
append
((
args
,
kwargs
))
to_delete
.
append
((
args
,
kwargs
))
def
rmtree_empty
(
*
args
,
**
kwargs
):
if
cleanup
:
to_delete_empty
.
append
((
args
,
kwargs
))
# add entries that are not in the entry_from_key dictionary
# add entries that are not in the entry_from_key dictionary
time_now
=
time
.
time
()
time_now
=
time
.
time
()
# Go through directories in alphabetical order to ensure consistent
# Go through directories in alphabetical order to ensure consistent
...
@@ -684,7 +690,11 @@ class ModuleCache(object):
...
@@ -684,7 +690,11 @@ class ModuleCache(object):
if
not
os
.
path
.
isdir
(
root
):
if
not
os
.
path
.
isdir
(
root
):
continue
continue
files
=
os
.
listdir
(
root
)
files
=
os
.
listdir
(
root
)
if
not
files
or
'delete.me'
in
files
:
if
not
files
:
rmtree_empty
(
root
,
ignore_nocleanup
=
True
,
msg
=
"empty dir"
)
continue
if
'delete.me'
in
files
:
rmtree
(
root
,
ignore_nocleanup
=
True
,
rmtree
(
root
,
ignore_nocleanup
=
True
,
msg
=
"delete.me found in dir"
)
msg
=
"delete.me found in dir"
)
continue
continue
...
@@ -900,10 +910,14 @@ class ModuleCache(object):
...
@@ -900,10 +910,14 @@ class ModuleCache(object):
pkl_file_to_remove
)
pkl_file_to_remove
)
self
.
loaded_key_pkl
.
remove
(
pkl_file_to_remove
)
self
.
loaded_key_pkl
.
remove
(
pkl_file_to_remove
)
if
to_delete
:
if
to_delete
or
to_delete_empty
:
with
compilelock
.
lock_ctx
():
with
compilelock
.
lock_ctx
():
for
a
,
kw
in
to_delete
:
for
a
,
kw
in
to_delete
:
_rmtree
(
*
a
,
**
kw
)
_rmtree
(
*
a
,
**
kw
)
for
a
,
kw
in
to_delete_empty
:
files
=
os
.
listdir
(
a
[
0
])
if
not
files
:
_rmtree
(
*
a
,
**
kw
)
_logger
.
debug
(
'Time needed to refresh cache:
%
s'
,
_logger
.
debug
(
'Time needed to refresh cache:
%
s'
,
(
time
.
time
()
-
start_time
))
(
time
.
time
()
-
start_time
))
...
...
theano/sandbox/cuda/opt.py
浏览文件 @
b9bfe165
...
@@ -300,7 +300,7 @@ def local_gpu_elemwise_1(node):
...
@@ -300,7 +300,7 @@ def local_gpu_elemwise_1(node):
@register_opt
()
@register_opt
()
@local_optimizer
([
tensor
.
Split
,
gpu_from_host
])
@local_optimizer
([
tensor
.
Split
])
def
local_gpu_split
(
node
):
def
local_gpu_split
(
node
):
if
isinstance
(
node
.
op
,
tensor
.
Split
):
if
isinstance
(
node
.
op
,
tensor
.
Split
):
input
=
node
.
inputs
[
0
]
input
=
node
.
inputs
[
0
]
...
@@ -308,13 +308,6 @@ def local_gpu_split(node):
...
@@ -308,13 +308,6 @@ def local_gpu_split(node):
new_op
=
GpuSplit
(
node
.
op
.
len_splits
)
new_op
=
GpuSplit
(
node
.
op
.
len_splits
)
split_res
=
new_op
(
gpu_from_host
(
input
),
*
node
.
inputs
[
1
:])
split_res
=
new_op
(
gpu_from_host
(
input
),
*
node
.
inputs
[
1
:])
return
[
host_from_gpu
(
o
)
for
o
in
split_res
]
return
[
host_from_gpu
(
o
)
for
o
in
split_res
]
if
isinstance
(
node
.
op
,
GpuFromHost
):
host_input
=
node
.
inputs
[
0
]
if
host_input
.
owner
and
isinstance
(
host_input
.
owner
.
op
,
tensor
.
Split
):
split_node
=
host_input
.
owner
new_op
=
GpuSplit
(
split_node
.
op
.
len_splits
)
return
new_op
(
gpu_from_host
(
split_node
.
inputs
[
0
]),
*
split_node
.
inputs
[
1
:])
return
False
return
False
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论