Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
bae00c0b
提交
bae00c0b
authored
2月 17, 2010
作者:
James Bergstra
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Deleted the old MergeOptimizer.exptime_apply_node_merge function
上级
440c6a83
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
0 行增加
和
35 行删除
+0
-35
opt.py
theano/gof/opt.py
+0
-35
没有找到文件。
theano/gof/opt.py
浏览文件 @
bae00c0b
...
@@ -235,41 +235,6 @@ class MergeOptimizer(Optimizer):
...
@@ -235,41 +235,6 @@ class MergeOptimizer(Optimizer):
const_sig
[
c
]
=
sig
const_sig
[
c
]
=
sig
const_sig_inv
[
sig
]
=
c
const_sig_inv
[
sig
]
=
c
def
exptime_apply_node_merge
(
self
,
env
):
# we clear the dicts because the Constants signatures are not necessarily hashable
# and it's more efficient to give them an integer like the other Variables
symbol_idx
=
{}
#variable -> int
symbol_idx_inv
=
{}
#int -> variable (inverse of symbol_idx)
#add all graph sources to the symbol_idx dictionaries (arbitrary order)
for
i
,
r
in
enumerate
(
r
for
r
in
env
.
variables
if
r
.
owner
is
None
):
symbol_idx
[
r
]
=
i
symbol_idx_inv
[
i
]
=
r
for
node
in
_list_of_nodes
(
env
):
node_cid
=
(
node
.
op
,
tuple
([
symbol_idx
[
input
]
for
input
in
node
.
inputs
]))
#print 'NODE', node, node_cid
dup
=
symbol_idx_inv
.
get
(
node_cid
,
None
)
success
=
False
if
dup
is
not
None
:
success
=
True
pairs
=
zip
(
node
.
outputs
,
dup
.
outputs
)
for
output
,
new_output
in
pairs
:
if
output
.
name
and
not
new_output
.
name
:
new_output
.
name
=
output
.
name
try
:
env
.
replace_all_validate
(
pairs
,
reason
=
'Merge (exptime)'
)
except
InconsistencyError
,
e
:
success
=
False
if
not
success
:
symbol_idx
[
node
]
=
node_cid
symbol_idx_inv
[
node_cid
]
=
node
for
i
,
output
in
enumerate
(
node
.
outputs
):
ref
=
(
i
,
node_cid
)
symbol_idx
[
output
]
=
ref
symbol_idx_inv
[
ref
]
=
output
def
apply_node_merge
(
self
,
env
):
def
apply_node_merge
(
self
,
env
):
# we clear the dicts because the Constants signatures are not necessarily hashable
# we clear the dicts because the Constants signatures are not necessarily hashable
# and it's more efficient to give them an integer like the other Variables
# and it's more efficient to give them an integer like the other Variables
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论