Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
9ad8e925
提交
9ad8e925
authored
6月 15, 2017
作者:
Reyhane Askari
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
replaced get_destroyers and fgraph.destroyers with has_destroyers
上级
4a3e0e49
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
7 行增加
和
7 行删除
+7
-7
function_module.py
theano/compile/function_module.py
+3
-3
destroyhandler.py
theano/gof/destroyhandler.py
+1
-1
opt.py
theano/tensor/opt.py
+3
-3
没有找到文件。
theano/compile/function_module.py
浏览文件 @
9ad8e925
...
...
@@ -195,7 +195,7 @@ def std_fgraph(input_specs, output_specs, accept_inplace=False):
for
spec
,
input
in
zip
(
input_specs
,
fgraph
.
inputs
)
if
not
(
spec
.
mutable
or
(
hasattr
(
fgraph
,
'destroyers'
)
and
fgraph
.
destroyers
(
input
)))))
fgraph
.
has_destroyers
([
input
]
)))))
# If named nodes are replaced, keep the name
for
feature
in
std_fgraph
.
features
:
...
...
@@ -1090,7 +1090,7 @@ def insert_deepcopy(fgraph, wrapped_inputs, wrapped_outputs):
# We can't use fgraph.inputs as this don't include Constant Value.
all_graph_inputs
=
gof
.
graph
.
inputs
(
fgraph
.
outputs
)
has_
get_destroyers
=
hasattr
(
fgraph
,
'get_destroyers_of
'
)
has_
destroyers_attr
=
hasattr
(
fgraph
,
'has_destroyers
'
)
for
i
in
xrange
(
len
(
fgraph
.
outputs
)):
views_of_output_i
=
set
()
...
...
@@ -1121,7 +1121,7 @@ def insert_deepcopy(fgraph, wrapped_inputs, wrapped_outputs):
# being updated
if
input_j
in
updated_fgraph_inputs
:
continue
if
input_j
in
views_of_output_i
and
not
(
has_
get_destroyers
and
fgraph
.
get_destroyers_of
(
input_j
)):
if
input_j
in
views_of_output_i
and
not
(
has_
destroyers_attr
and
fgraph
.
has_destroyers
([
input_j
]
)):
# We don't put deep_copy_op if the input and the
# output have borrow==True
if
input_j
in
fgraph
.
inputs
:
...
...
theano/gof/destroyhandler.py
浏览文件 @
9ad8e925
...
...
@@ -250,7 +250,7 @@ def fast_inplace_check(inputs):
inputs
=
[
i
for
i
in
inputs
if
not
isinstance
(
i
,
graph
.
Constant
)
and
not
fgraph
.
destroyers
(
i
)
and
not
fgraph
.
has_destroyers
([
i
]
)
and
i
not
in
protected_inputs
]
return
inputs
...
...
theano/tensor/opt.py
浏览文件 @
9ad8e925
...
...
@@ -265,8 +265,8 @@ class InplaceElemwiseOptimizer(Optimizer):
candidate_inputs
=
[
i
for
i
in
xrange
(
len
(
node
.
inputs
))
if
i
not
in
baseline
.
values
()
and
not
isinstance
(
node
.
inputs
[
i
],
Constant
)
and
# Is next line costly?
not
fgraph
.
destroyers
(
node
.
inputs
[
i
])
and
# Is next line costly?
(used to be fgraph.get_destroyers)
not
fgraph
.
has_destroyers
([
node
.
inputs
[
i
]
])
and
node
.
inputs
[
i
]
not
in
protected_inputs
]
else
:
baseline
=
[]
...
...
@@ -277,7 +277,7 @@ class InplaceElemwiseOptimizer(Optimizer):
# Remove here as faster.
candidate_inputs
=
[
i
for
i
in
xrange
(
len
(
node
.
inputs
))
if
not
isinstance
(
node
.
inputs
[
i
],
Constant
)
and
not
fgraph
.
destroyers
(
node
.
inputs
[
i
])
and
not
fgraph
.
has_destroyers
([
node
.
inputs
[
i
]
])
and
node
.
inputs
[
i
]
not
in
protected_inputs
]
verbose
=
False
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论