Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
ec10f9a6
提交
ec10f9a6
authored
1月 29, 2015
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2450 from nouiz/lock
Lock
上级
0899f5e4
1d038542
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
9 行增加
和
2 行删除
+9
-2
debugmode.py
theano/compile/debugmode.py
+1
-1
compilelock.py
theano/gof/compilelock.py
+8
-1
没有找到文件。
theano/compile/debugmode.py
浏览文件 @
ec10f9a6
...
@@ -585,7 +585,7 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False,
...
@@ -585,7 +585,7 @@ def debugprint(r, prefix='', depth=-1, done=None, print_type=False,
already_printed
=
a
in
done
# get_id_str put it in the dict
already_printed
=
a
in
done
# get_id_str put it in the dict
id_str
=
get_id_str
(
a
)
id_str
=
get_id_str
(
a
)
if
profile
==
None
:
if
profile
==
None
or
a
not
in
profile
.
apply_time
:
if
len
(
a
.
outputs
)
==
1
:
if
len
(
a
.
outputs
)
==
1
:
print
>>
file
,
'
%
s
%
s
%
s
%
s
\'
%
s
\'
%
s
%
s
%
s'
%
(
prefix
,
a
.
op
,
print
>>
file
,
'
%
s
%
s
%
s
%
s
\'
%
s
\'
%
s
%
s
%
s'
%
(
prefix
,
a
.
op
,
id_str
,
id_str
,
...
...
theano/gof/compilelock.py
浏览文件 @
ec10f9a6
...
@@ -97,6 +97,13 @@ def get_lock(lock_dir=None, **kw):
...
@@ -97,6 +97,13 @@ def get_lock(lock_dir=None, **kw):
# every 'config.compile.timeout / 2' seconds to ensure
# every 'config.compile.timeout / 2' seconds to ensure
# no one else tries to override our lock after their
# no one else tries to override our lock after their
# 'config.compile.timeout' timeout period.
# 'config.compile.timeout' timeout period.
if
get_lock
.
start_time
is
None
:
# This should not happen. So if this happen, clean up
# the lock state and raise an error.
while
get_lock
.
n_lock
>
0
:
release_lock
()
raise
Exception
(
"For some unknow reason, the lock was already taken,"
" but no start time was registered."
)
now
=
time
.
time
()
now
=
time
.
time
()
if
now
-
get_lock
.
start_time
>
config
.
compile
.
timeout
/
2
:
if
now
-
get_lock
.
start_time
>
config
.
compile
.
timeout
/
2
:
lockpath
=
os
.
path
.
join
(
get_lock
.
lock_dir
,
'lock'
)
lockpath
=
os
.
path
.
join
(
get_lock
.
lock_dir
,
'lock'
)
...
@@ -320,7 +327,7 @@ def refresh_lock(lock_file):
...
@@ -320,7 +327,7 @@ def refresh_lock(lock_file):
# from failing, we release the lock, but as there is a
# from failing, we release the lock, but as there is a
# problem, we still keep the original exception.
# problem, we still keep the original exception.
# This way, only 1 test would fail.
# This way, only 1 test would fail.
while
get_lock
.
lock_is_enabled
:
while
get_lock
.
n_lock
>
0
:
release_lock
()
release_lock
()
_logger
.
warn
(
'Refreshing lock failed, we release the'
_logger
.
warn
(
'Refreshing lock failed, we release the'
' lock before raising again the exception'
)
' lock before raising again the exception'
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论