Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
fb585866
提交
fb585866
authored
3月 28, 2012
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Also consider view_map when copying inputs
If an input is viewed, and the corresponding output is destroyed, then it destroys the input. There would be ways to be more precise, but at least this is correct.
上级
cf30d7d3
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
10 行增加
和
3 行删除
+10
-3
debugmode.py
theano/compile/debugmode.py
+10
-3
没有找到文件。
theano/compile/debugmode.py
浏览文件 @
fb585866
...
@@ -1195,10 +1195,13 @@ def _check_preallocated_output(node, thunk, prealloc_modes, def_val,
...
@@ -1195,10 +1195,13 @@ def _check_preallocated_output(node, thunk, prealloc_modes, def_val,
dr_vals
,
perform
,
active_order_set
):
dr_vals
,
perform
,
active_order_set
):
_logger
.
debug
(
' name =
%
s'
,
name
)
_logger
.
debug
(
' name =
%
s'
,
name
)
# Copy the inputs over, if they were marked as destroyed
# Copy the inputs over, if they were marked as destroyed or viewed
# (we will destroy the output at some point so it can destroy
# the input)
dmap
=
getattr
(
node
.
op
,
'destroy_map'
,
{})
dmap
=
getattr
(
node
.
op
,
'destroy_map'
,
{})
vmap
=
getattr
(
node
.
op
,
'view_map'
,
{})
for
i
,
r
in
enumerate
(
node
.
inputs
):
for
i
,
r
in
enumerate
(
node
.
inputs
):
if
any
(
i
in
v
for
v
in
dmap
.
values
(
)):
if
any
(
i
in
v
for
v
in
(
dmap
.
values
()
+
vmap
.
values
()
)):
storage_map
[
r
][
0
]
=
_lessbroken_deepcopy
(
r_vals
[
r
])
storage_map
[
r
][
0
]
=
_lessbroken_deepcopy
(
r_vals
[
r
])
# Get the appropriate output storages
# Get the appropriate output storages
...
@@ -1743,6 +1746,7 @@ class _Linker(gof.link.LocalLinker):
...
@@ -1743,6 +1746,7 @@ class _Linker(gof.link.LocalLinker):
clobber
=
True
clobber
=
True
if
thunk_py
:
if
thunk_py
:
dmap
=
getattr
(
node
.
op
,
'destroy_map'
,
{})
dmap
=
getattr
(
node
.
op
,
'destroy_map'
,
{})
vmap
=
getattr
(
node
.
op
,
'view_map'
,
{})
for
i
,
r
in
enumerate
(
node
.
inputs
):
for
i
,
r
in
enumerate
(
node
.
inputs
):
# if thunk_py ran, and we still got this far,
# if thunk_py ran, and we still got this far,
# it means that the destroy_map of the Op (and view_map) are
# it means that the destroy_map of the Op (and view_map) are
...
@@ -1751,7 +1755,10 @@ class _Linker(gof.link.LocalLinker):
...
@@ -1751,7 +1755,10 @@ class _Linker(gof.link.LocalLinker):
# fact not been destroyed.
# fact not been destroyed.
# Therefore... we only need to overwrite inputs that *have*
# Therefore... we only need to overwrite inputs that *have*
# been marked as destroyed.
# been marked as destroyed.
if
any
(
i
in
v
for
v
in
dmap
.
values
()):
# Inputs marked as viewd are unsafe too,
# because the corresponding output can
# be destroyed.
if
any
(
i
in
v
for
v
in
(
dmap
.
values
()
+
vmap
.
values
())):
storage_map
[
r
][
0
]
=
_lessbroken_deepcopy
(
r_vals
[
r
])
storage_map
[
r
][
0
]
=
_lessbroken_deepcopy
(
r_vals
[
r
])
clobber
=
False
clobber
=
False
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论