Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
faee95e7
提交
faee95e7
authored
3月 04, 2009
作者:
James Bergstra
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed ticket #326
上级
0696cbd2
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
9 行增加
和
5 行删除
+9
-5
debugmode.py
theano/compile/debugmode.py
+9
-5
没有找到文件。
theano/compile/debugmode.py
浏览文件 @
faee95e7
...
...
@@ -207,7 +207,7 @@ def _optcheck_env(input_specs, output_specs, accept_inplace = False):
env
.
extend
(
Supervisor
(
input
for
spec
,
input
in
zip
(
input_specs
,
inputs
)
if
not
(
spec
.
mutable
or
(
hasattr
(
env
,
'destroyers'
)
and
env
.
destroyers
(
input
)))))
return
env
,
map
(
SymbolicOutput
,
updates
),
equivalence_tracker
def
_check_inputs
(
node
,
storage_map
,
r_vals
,
dr_vals
,
active_nodes
):
def
_check_inputs
(
node
,
storage_map
,
r_vals
,
dr_vals
,
active_nodes
,
clobber_dr_vals
=
True
):
"""Raise BadDestroyMap if necessary, update dr_vals"""
destroyed_idx_list
=
[]
destroy_map
=
getattr
(
node
.
op
,
'destroy_map'
,
{})
...
...
@@ -225,7 +225,9 @@ def _check_inputs(node, storage_map, r_vals, dr_vals, active_nodes):
if
dr_vals
.
get
(
r
,
(
0
,
node
))[
1
]
is
not
node
:
# bad: there should only be one active node that destroys any result
raise
Exception
(
'failure in topological ordering'
)
dr_vals
[
r
]
=
(
storage_map
[
r
][
0
],
node
)
#no copy, this is the last use of this variable
if
clobber_dr_vals
:
dr_vals
[
r
]
=
(
storage_map
[
r
][
0
],
node
)
#no copy, this is the last use of this variable
storage_map
[
r
][
0
]
=
None
#make sure that dr_vals[r] doens't get used again
else
:
raise
BadDestroyMap
(
node
,
r_idx
,
r_vals
[
r
],
storage_map
[
r
][
0
])
...
...
@@ -572,10 +574,10 @@ class _Linker(gof.link.LocalLinker):
thunk
.
inputs
=
node_input_storage
thunk
.
outputs
=
node_output_storage
thunks_c
.
append
(
thunk
)
except
(
NotImplementedError
,
utils
.
AbstractFunctionError
):
thunks_c
.
append
(
None
)
p
=
node
.
op
.
perform
thunk
=
(
lambda
p
=
p
,
i
=
node_input_storage
,
o
=
node_output_storage
,
n
=
node
:
p
(
n
,
[
x
[
0
]
for
x
in
i
],
o
))
...
...
@@ -640,7 +642,8 @@ class _Linker(gof.link.LocalLinker):
thunk_py
()
_check_inputs
(
node
,
storage_map
,
r_vals
,
dr_vals
,
active_order_set
)
_check_inputs
(
node
,
storage_map
,
r_vals
,
dr_vals
,
active_order_set
,
clobber_dr_vals
=
True
)
#retrieve each output from the storage_map
for
r
in
node
.
outputs
:
...
...
@@ -660,7 +663,8 @@ class _Linker(gof.link.LocalLinker):
thunk_c
()
_check_inputs
(
node
,
storage_map
,
r_vals
,
dr_vals
,
active_order_set
)
_check_inputs
(
node
,
storage_map
,
r_vals
,
dr_vals
,
active_order_set
,
clobber_dr_vals
=
False
)
for
r
in
node
.
outputs
:
if
not
r
.
type
.
is_valid_value
(
storage_map
[
r
][
0
]):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论