Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
0b528507
提交
0b528507
authored
11月 08, 2013
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
some pep8
上级
8e80196b
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
13 行增加
和
9 行删除
+13
-9
opt.py
theano/gof/opt.py
+13
-9
没有找到文件。
theano/gof/opt.py
浏览文件 @
0b528507
...
@@ -514,7 +514,8 @@ class MergeFeature(object):
...
@@ -514,7 +514,8 @@ class MergeFeature(object):
continue
continue
inputs_match
=
all
(
node_in
is
cand_in
inputs_match
=
all
(
node_in
is
cand_in
for
node_in
,
cand_in
in
zip
(
node
.
inputs
,
candidate
.
inputs
))
for
node_in
,
cand_in
in
zip
(
node
.
inputs
,
candidate
.
inputs
))
if
inputs_match
and
node
.
op
==
candidate
.
op
:
if
inputs_match
and
node
.
op
==
candidate
.
op
:
if
(
node
,
candidate
)
in
self
.
blacklist
:
if
(
node
,
candidate
)
in
self
.
blacklist
:
# They were already tried, and there was an error
# They were already tried, and there was an error
...
@@ -811,8 +812,8 @@ class LocalOptGroup(LocalOptimizer):
...
@@ -811,8 +812,8 @@ class LocalOptGroup(LocalOptimizer):
def
__str__
(
self
):
def
__str__
(
self
):
return
getattr
(
self
,
'__name__'
,
return
getattr
(
self
,
'__name__'
,
(
'<theano.gof.opt.LocalOptGroup instance>'
(
'<theano.gof.opt.LocalOptGroup instance>'
+
+
str
([
str
(
o
)
for
o
in
self
.
opts
])))
str
([
str
(
o
)
for
o
in
self
.
opts
])))
def
transform
(
self
,
node
):
def
transform
(
self
,
node
):
for
opt
in
self
.
opts
:
for
opt
in
self
.
opts
:
...
@@ -990,9 +991,9 @@ class PatternSub(LocalOptimizer):
...
@@ -990,9 +991,9 @@ class PatternSub(LocalOptimizer):
else
:
else
:
raise
TypeError
(
"The pattern to search for must start with "
raise
TypeError
(
"The pattern to search for must start with "
"a specific Op instance."
)
"a specific Op instance."
)
self
.
__doc__
=
(
self
.
__class__
.
__doc__
self
.
__doc__
=
(
self
.
__class__
.
__doc__
+
+
"
\n\n
This instance does: "
"
\n\n
This instance does: "
+
+
str
(
self
)
+
"
\n
"
)
str
(
self
)
+
"
\n
"
)
self
.
allow_multiple_clients
=
allow_multiple_clients
self
.
allow_multiple_clients
=
allow_multiple_clients
self
.
skip_identities_fn
=
skip_identities_fn
self
.
skip_identities_fn
=
skip_identities_fn
if
name
:
if
name
:
...
@@ -1286,7 +1287,8 @@ class NavigatorOptimizer(Optimizer):
...
@@ -1286,7 +1287,8 @@ class NavigatorOptimizer(Optimizer):
except
Exception
,
e
:
except
Exception
,
e
:
if
self
.
failure_callback
is
not
None
:
if
self
.
failure_callback
is
not
None
:
self
.
failure_callback
(
e
,
self
,
self
.
failure_callback
(
e
,
self
,
[(
x
,
None
)
for
x
in
node
.
outputs
],
lopt
)
[(
x
,
None
)
for
x
in
node
.
outputs
],
lopt
)
return
False
return
False
else
:
else
:
raise
raise
...
@@ -1623,7 +1625,8 @@ class EquilibriumOptimizer(NavigatorOptimizer):
...
@@ -1623,7 +1625,8 @@ class EquilibriumOptimizer(NavigatorOptimizer):
+
"
%
f with the theano flag 'optdb.max_use_ratio'."
%
+
"
%
f with the theano flag 'optdb.max_use_ratio'."
%
config
.
optdb
.
max_use_ratio
)
config
.
optdb
.
max_use_ratio
)
return
(
self
,
loop_timing
,
loop_process_count
,
(
start_nb_nodes
,
end_nb_nodes
,
max_nb_nodes
),
return
(
self
,
loop_timing
,
loop_process_count
,
(
start_nb_nodes
,
end_nb_nodes
,
max_nb_nodes
),
global_opt_timing
,
nb_nodes
,
time_opts
,
io_toposort_timing
)
global_opt_timing
,
nb_nodes
,
time_opts
,
io_toposort_timing
)
def
print_summary
(
self
,
stream
=
sys
.
stdout
,
level
=
0
,
depth
=-
1
):
def
print_summary
(
self
,
stream
=
sys
.
stdout
,
level
=
0
,
depth
=-
1
):
...
@@ -1637,7 +1640,8 @@ class EquilibriumOptimizer(NavigatorOptimizer):
...
@@ -1637,7 +1640,8 @@ class EquilibriumOptimizer(NavigatorOptimizer):
@staticmethod
@staticmethod
def
print_profile
(
stream
,
prof
,
level
=
0
):
def
print_profile
(
stream
,
prof
,
level
=
0
):
(
opt
,
loop_timing
,
loop_process_count
,
(
start_nb_nodes
,
end_nb_nodes
,
max_nb_nodes
),
(
opt
,
loop_timing
,
loop_process_count
,
(
start_nb_nodes
,
end_nb_nodes
,
max_nb_nodes
),
global_opt_timing
,
nb_nodes
,
time_opts
,
io_toposort_timing
)
=
prof
global_opt_timing
,
nb_nodes
,
time_opts
,
io_toposort_timing
)
=
prof
blanc
=
(
' '
*
level
)
blanc
=
(
' '
*
level
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论