Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
ff3a67f1
提交
ff3a67f1
authored
11月 21, 2020
作者:
Brandon T. Willard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Minor changes/removals to comments in theano.gof.opt
上级
ad943410
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
14 行增加
和
23 行删除
+14
-23
opt.py
theano/gof/opt.py
+14
-23
没有找到文件。
theano/gof/opt.py
浏览文件 @
ff3a67f1
...
...
@@ -750,8 +750,6 @@ class MergeOptimizer(GlobalOptimizer):
"""
def
add_requirements
(
self
,
fgraph
):
# Added by default
# fgraph.attach_feature(toolbox.ReplaceValidate())
if
not
hasattr
(
fgraph
,
"merge_feature"
):
fgraph
.
attach_feature
(
MergeFeature
())
...
...
@@ -773,12 +771,12 @@ class MergeOptimizer(GlobalOptimizer):
success
=
True
for
pairs_
in
pairs_list
:
# We must check again the equivalence, as the graph
# c
an ha
ve changed. If so, doing the replacement can
# introduce
node that depend
on itself. Doing the
# full check of such cycle
everytimes
is very time
# consum
ming. I think this double check is faster the
n
# c
ould'
ve changed. If so, doing the replacement can
# introduce
a node that depends
on itself. Doing the
# full check of such cycle
s every time
is very time
# consum
ing. I think this double check is faster tha
n
# doing the full cycle check. The full cycle check is
# skipped by validate() if the graph don't contain
# skipped by validate() if the graph do
es
n't contain
# destroyers.
var
,
candidate
,
merge_mode
=
pairs_
[
0
]
if
merge_mode
==
"new_node"
and
var
in
fgraph
.
variables
:
...
...
@@ -1404,7 +1402,7 @@ class LocalOptGroup(LocalOptimizer):
# Skip opt that have 0 times, they probably wasn't even tried.
print
(
blanc
+
" "
,
f
" {t:.3f}s - {o}"
,
file
=
stream
)
else
:
print
(
blanc
,
" The
O
ptimizer wasn't successful "
,
file
=
stream
)
print
(
blanc
,
" The
o
ptimizer wasn't successful "
,
file
=
stream
)
print
(
file
=
stream
)
...
...
@@ -2337,7 +2335,8 @@ class EquilibriumOptimizer(NavigatorOptimizer):
Global optimizers that apply a list of pre determined optimization.
They must not traverse the graph as they are called very frequently.
The MergeOptimizer is one example of optimization that respect this.
They are applied after all global optimizer, then when one local optimizer is applied, then after all final optimizer.
They are applied after all global optimizers, then when one local
optimizer is applied, then after all final optimizers.
"""
...
...
@@ -2873,11 +2872,6 @@ class EquilibriumOptimizer(NavigatorOptimizer):
)
#################
# Utilities #
#################
def
_check_chain
(
r
,
chain
):
"""
WRITEME
...
...
@@ -2910,9 +2904,6 @@ def _check_chain(r, chain):
return
r
is
not
None
# _check_chain.n_calls = 0
def
check_chain
(
r
,
*
chain
):
"""
WRITEME
...
...
@@ -2935,15 +2926,15 @@ def pre_greedy_local_optimizer(fgraph, optimizations, out):
Its main use is to apply locally constant folding when generating
the graph of the indices of a subtensor.
We should not apply optimizations on node that are in fgraph.
So we don't optimize node that have an attribute fgraph
.
Changes should not be applied to nodes that are in an `fgraph`,
so we use `fgraph` to prevent that
.
Notes
-----
This doesn't do an equilibrium
... So
if there is optimization
like
local_upcast_elemwise_constant_inputs in the list, that
add
s additional node to the inputs of the node, it can
be needed to call
this function multiple times.
This doesn't do an equilibrium
optimization, so,
if there is optimization
like
`local_upcast_elemwise_constant_inputs` in the list that adds
add
itional nodes to the inputs of the node, it might be necessary to call
this function multiple times.
Parameters
----------
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论