Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
d839d267
提交
d839d267
authored
8月 02, 2013
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use the same reason as the tag of the optimization.
This allow to easily know how to disable that specific optimization.
上级
f293a0f6
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
8 行增加
和
8 行删除
+8
-8
scan_opt.py
theano/scan_module/scan_opt.py
+8
-8
没有找到文件。
theano/scan_module/scan_opt.py
浏览文件 @
d839d267
...
@@ -289,7 +289,7 @@ class PushOutNonSeqScan(gof.Optimizer):
...
@@ -289,7 +289,7 @@ class PushOutNonSeqScan(gof.Optimizer):
fgraph
.
replace_all_validate_remove
(
fgraph
.
replace_all_validate_remove
(
zip
(
node
.
outputs
,
nw_node
.
outputs
),
zip
(
node
.
outputs
,
nw_node
.
outputs
),
remove
=
[
node
],
remove
=
[
node
],
reason
=
'scan
_push_computation_out
'
)
reason
=
'scan
Op_pushout_nonseqs_ops
'
)
return
True
return
True
elif
to_keep
==
[]:
elif
to_keep
==
[]:
# Nothing in the inner graph should be kept
# Nothing in the inner graph should be kept
...
@@ -310,7 +310,7 @@ class PushOutNonSeqScan(gof.Optimizer):
...
@@ -310,7 +310,7 @@ class PushOutNonSeqScan(gof.Optimizer):
fgraph
.
replace_all_validate_remove
(
fgraph
.
replace_all_validate_remove
(
replace_with
.
items
(),
replace_with
.
items
(),
remove
=
[
node
],
remove
=
[
node
],
reason
=
'scan
_push_computation_out
'
)
reason
=
'scan
Op_pushout_nonseqs_ops
'
)
else
:
else
:
return
False
return
False
...
@@ -478,7 +478,7 @@ class PushOutSeqScan(gof.Optimizer):
...
@@ -478,7 +478,7 @@ class PushOutSeqScan(gof.Optimizer):
fgraph
.
replace_all_validate_remove
(
fgraph
.
replace_all_validate_remove
(
zip
(
node
.
outputs
,
nw_node
.
outputs
),
zip
(
node
.
outputs
,
nw_node
.
outputs
),
remove
=
[
node
],
remove
=
[
node
],
reason
=
'scan
_push_computation_out
'
)
reason
=
'scan
Op_pushout_seqs_ops
'
)
return
True
return
True
elif
(
to_keep
==
[]
and
elif
(
to_keep
==
[]
and
not
op
.
as_while
and
not
op
.
as_while
and
...
@@ -510,7 +510,7 @@ class PushOutSeqScan(gof.Optimizer):
...
@@ -510,7 +510,7 @@ class PushOutSeqScan(gof.Optimizer):
fgraph
.
replace_all_validate_remove
(
fgraph
.
replace_all_validate_remove
(
replace_with
.
items
(),
replace_with
.
items
(),
remove
=
[
node
],
remove
=
[
node
],
reason
=
'scan
_push_seq_computation_out
'
)
reason
=
'scan
Op_pushout_seqs_ops
'
)
else
:
else
:
return
False
return
False
...
@@ -568,7 +568,7 @@ class ScanInplaceOptimizer(Optimizer):
...
@@ -568,7 +568,7 @@ class ScanInplaceOptimizer(Optimizer):
fgraph
.
replace_all_validate_remove
(
fgraph
.
replace_all_validate_remove
(
zip
(
node
.
outputs
,
new_outs
),
zip
(
node
.
outputs
,
new_outs
),
remove
=
[
node
],
remove
=
[
node
],
reason
=
self
.
__class__
.
__name__
)
reason
=
'scanOp_make_inplace'
)
op
=
new_op
op
=
new_op
node
=
new_outs
[
0
]
.
owner
node
=
new_outs
[
0
]
.
owner
except
InconsistencyError
,
e
:
except
InconsistencyError
,
e
:
...
@@ -1042,7 +1042,7 @@ class ScanSaveMem(gof.Optimizer):
...
@@ -1042,7 +1042,7 @@ class ScanSaveMem(gof.Optimizer):
remove
.
append
(
node
)
remove
.
append
(
node
)
fgraph
.
replace_all_validate_remove
(
old_new
,
fgraph
.
replace_all_validate_remove
(
old_new
,
remove
,
remove
,
reason
=
'scan_save_mem'
)
reason
=
'scan
Op
_save_mem'
)
def
apply
(
self
,
fgraph
):
def
apply
(
self
,
fgraph
):
...
@@ -1230,7 +1230,7 @@ class ScanMerge(gof.Optimizer):
...
@@ -1230,7 +1230,7 @@ class ScanMerge(gof.Optimizer):
proposal
=
self
.
merge
(
subset
)
proposal
=
self
.
merge
(
subset
)
fgraph
.
replace_all_validate_remove
(
proposal
,
fgraph
.
replace_all_validate_remove
(
proposal
,
remove
=
subset
,
remove
=
subset
,
reason
=
'scan_merge'
)
reason
=
'scan
Op
_merge'
)
def
has_duplicates
(
l
):
def
has_duplicates
(
l
):
...
@@ -1594,7 +1594,7 @@ class PushOutDot1(gof.Optimizer):
...
@@ -1594,7 +1594,7 @@ class PushOutDot1(gof.Optimizer):
old_new
+=
zip
(
node
.
outputs
[
pos
+
1
:],
new_outs
[
pos
:])
old_new
+=
zip
(
node
.
outputs
[
pos
+
1
:],
new_outs
[
pos
:])
fgraph
.
replace_all_validate_remove
(
old_new
,
fgraph
.
replace_all_validate_remove
(
old_new
,
remove
=
[
node
],
remove
=
[
node
],
reason
=
'
PushOutD
ot1'
)
reason
=
'
scan_pushout_d
ot1'
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论