Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
be990f83
提交
be990f83
authored
12月 17, 2013
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix crah in the optimizer profiler.
上级
2b806f0b
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
16 行增加
和
11 行删除
+16
-11
opt.py
theano/gof/opt.py
+16
-11
没有找到文件。
theano/gof/opt.py
浏览文件 @
be990f83
...
@@ -289,9 +289,9 @@ class SeqOptimizer(Optimizer, list):
...
@@ -289,9 +289,9 @@ class SeqOptimizer(Optimizer, list):
prof2
[
1
][
idx2
])
prof2
[
1
][
idx2
])
new_l
.
append
(
l
)
new_l
.
append
(
l
)
if
hasattr
(
l
,
'merge_profile'
):
if
hasattr
(
l
,
'merge_profile'
):
assert
len
(
prof1
[
5
][
idx1
])
==
len
(
prof2
[
5
][
idx1
])
assert
len
(
prof1
[
6
][
idx1
])
==
len
(
prof2
[
6
][
idx2
])
new_sub_profile
.
append
(
l
.
merge_profile
(
prof1
[
5
][
idx1
],
new_sub_profile
.
append
(
l
.
merge_profile
(
prof1
[
6
][
idx1
],
prof2
[
5
][
idx2
]))
prof2
[
6
][
idx2
]))
else
:
else
:
new_sub_profile
.
append
(
None
)
new_sub_profile
.
append
(
None
)
...
@@ -315,10 +315,10 @@ class SeqOptimizer(Optimizer, list):
...
@@ -315,10 +315,10 @@ class SeqOptimizer(Optimizer, list):
p
=
prof2
p
=
prof2
new_t
[
idx
]
+=
p
[
1
][
p
[
0
]
.
index
(
l
)]
new_t
[
idx
]
+=
p
[
1
][
p
[
0
]
.
index
(
l
)]
if
hasattr
(
l
,
'merge_profile'
):
if
hasattr
(
l
,
'merge_profile'
):
assert
len
(
p
[
5
][
p
[
0
]
.
index
(
l
)])
==
\
assert
len
(
p
[
6
][
p
[
0
]
.
index
(
l
)])
==
\
len
(
new_sub_profile
[
idx
])
len
(
new_sub_profile
[
idx
])
new_sub_profile
[
idx
]
=
l
.
merge_profile
(
new_sub_profile
[
idx
]
=
l
.
merge_profile
(
new_sub_profile
[
idx
],
p
[
5
][
p
[
0
]
.
index
(
l
)])
new_sub_profile
[
idx
],
p
[
6
][
p
[
0
]
.
index
(
l
)])
else
:
else
:
new_sub_profile
[
idx
]
=
None
new_sub_profile
[
idx
]
=
None
continue
continue
...
@@ -329,14 +329,19 @@ class SeqOptimizer(Optimizer, list):
...
@@ -329,14 +329,19 @@ class SeqOptimizer(Optimizer, list):
new_t
.
append
(
p
[
1
][
p
[
0
]
.
index
(
l
)])
new_t
.
append
(
p
[
1
][
p
[
0
]
.
index
(
l
)])
idx
=
p
[
0
]
.
index
(
l
)
idx
=
p
[
0
]
.
index
(
l
)
new_l
.
append
(
l
)
new_l
.
append
(
l
)
new_sub_profile
.
append
(
p
[
5
][
idx
])
new_sub_profile
.
append
(
p
[
6
][
idx
])
new_opt
=
SeqOptimizer
(
*
new_l
)
new_opt
=
SeqOptimizer
(
*
new_l
)
assert
set
(
prof1
[
0
])
.
issubset
(
set
(
new_l
))
#We need to assert based on the name as we merge also based on
# assert set(prof2[0]).issubset(set(new_l))
#the name.
assert
set
([
l
.
name
for
l
in
prof1
[
0
]])
.
issubset
(
set
([
l
.
name
for
l
in
new_l
]))
assert
set
([
l
.
name
for
l
in
prof2
[
0
]])
.
issubset
(
set
([
l
.
name
for
l
in
new_l
]))
assert
len
(
new_t
)
==
len
(
new_opt
)
==
len
(
new_sub_profile
)
assert
len
(
new_t
)
==
len
(
new_opt
)
==
len
(
new_sub_profile
)
return
(
new_opt
,
new_t
,
prof1
[
2
]
+
prof2
[
2
],
return
(
new_opt
,
new_t
,
prof1
[
2
]
+
prof2
[
2
],
-
1
,
-
1
,
new_sub_profile
)
prof1
[
3
]
+
prof2
[
3
],
-
1
,
-
1
,
new_sub_profile
,
[])
class
_metadict
:
class
_metadict
:
...
@@ -1746,7 +1751,7 @@ class EquilibriumOptimizer(NavigatorOptimizer):
...
@@ -1746,7 +1751,7 @@ class EquilibriumOptimizer(NavigatorOptimizer):
loop_timing
=
merge_list
(
prof1
[
1
],
prof2
[
1
])
loop_timing
=
merge_list
(
prof1
[
1
],
prof2
[
1
])
loop_process_count
=
prof1
[
2
]
.
copy
(
)
loop_process_count
=
list
(
prof1
[
2
]
)
for
i
in
range
(
len
(
loop_process_count
)):
for
i
in
range
(
len
(
loop_process_count
)):
process_count
=
loop_process_count
[
i
]
process_count
=
loop_process_count
[
i
]
for
process
,
count
in
prof2
[
2
][
i
]
.
iteritems
():
for
process
,
count
in
prof2
[
2
][
i
]
.
iteritems
():
...
@@ -1755,7 +1760,7 @@ class EquilibriumOptimizer(NavigatorOptimizer):
...
@@ -1755,7 +1760,7 @@ class EquilibriumOptimizer(NavigatorOptimizer):
else
:
else
:
process_count
[
process
]
=
count
process_count
[
process
]
=
count
for
i
in
range
(
len
(
loop_process_count
),
len
(
prof2
[
2
])):
for
i
in
range
(
len
(
loop_process_count
),
len
(
prof2
[
2
])):
loop_process_count
.
append
(
prof2
[
2
]
.
copy
(
))
loop_process_count
.
append
(
list
(
prof2
[
2
]
))
max_nb_nodes
=
max
(
prof1
[
3
],
prof2
[
3
])
max_nb_nodes
=
max
(
prof1
[
3
],
prof2
[
3
])
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论