Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
daf7ea76
提交
daf7ea76
authored
7月 29, 2015
作者:
Iulian Vlad Serban
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed bugs and restructured code. Implemented Fred's comments.
上级
72ad300a
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
14 行增加
和
13 行删除
+14
-13
fg.py
theano/gof/fg.py
+1
-1
link.py
theano/gof/link.py
+1
-1
op.py
theano/gof/op.py
+1
-1
opt.py
theano/tensor/opt.py
+11
-10
没有找到文件。
theano/gof/fg.py
浏览文件 @
daf7ea76
...
...
@@ -450,7 +450,7 @@ class FunctionGraph(utils.object2):
assert
path
is
not
None
tr
=
getattr
(
r
.
tag
,
'trace'
,
[])
detailed_err_msg
=
""
if
len
(
tr
)
>
0
:
if
type
(
tr
)
is
list
and
len
(
tr
)
>
0
:
detailed_err_msg
+=
"
\n
Backtrace when the variable is created:
\n
"
# Print separate message for each element in
...
...
theano/gof/link.py
浏览文件 @
daf7ea76
...
...
@@ -168,7 +168,7 @@ def raise_with_op(node, thunk=None, exc_info=None, storage_map=None):
# Print node backtraces
tr
=
getattr
(
node
.
outputs
[
0
]
.
tag
,
'trace'
,
[])
if
len
(
tr
)
>
0
:
if
type
(
tr
)
is
list
and
len
(
tr
)
>
0
:
detailed_err_msg
+=
"
\n
Backtrace when the node is created:
\n
"
# Print separate message for each element in the list of batcktraces
...
...
theano/gof/op.py
浏览文件 @
daf7ea76
...
...
@@ -542,7 +542,7 @@ class PureOp(object):
"For compute_test_value, one input test value does not"
" have the requested type.
\n
"
)
tr
=
getattr
(
v
.
tag
,
'trace'
,
[])
if
len
(
tr
)
>
0
:
if
type
(
tr
)
is
list
and
len
(
tr
)
>
0
:
detailed_err_msg
+=
(
"
\n
Backtrace when that variable is created:
\n
"
)
# Print separate message for each element in the list
...
...
theano/tensor/opt.py
浏览文件 @
daf7ea76
...
...
@@ -87,15 +87,13 @@ def copy_stack_trace(from_var, to_var):
tr
=
[]
if
type
(
from_var
)
is
list
:
# If from_var is a list, store concatenated stack traces
if
len
(
from_var
)
>
0
:
for
v
in
from_var
:
if
hasattr
(
v
.
tag
,
'trace'
):
tr
=
tr
+
v
.
tag
.
trace
tr
+=
getattr
(
v
.
tag
,
'trace'
,
[])
else
:
# If from_var is not a list, it must be a single tensor
# variable, so just store that particular stack trace
if
hasattr
(
from_var
.
tag
,
'trace'
):
tr
=
from_var
.
tag
.
trace
tr
=
getattr
(
from_var
.
tag
,
'trace'
,
[])
# Copy over stack traces to to_var
if
type
(
to_var
)
is
list
:
...
...
@@ -1872,7 +1870,10 @@ def local_subtensor_make_vector(node):
try
:
const_slice
=
node
.
op
.
get_constant_idx
(
node
.
inputs
,
allow_partial
=
False
)[
0
]
return
[
make_vector
(
*
x
.
owner
.
inputs
[
const_slice
])]
ret
=
make_vector
(
*
x
.
owner
.
inputs
[
const_slice
])
# Copy over stack trace from previous outputs to new output
copy_stack_trace
(
node
.
outputs
,
ret
)
return
[
ret
]
except
NotScalarConstantError
:
pass
else
:
...
...
@@ -2001,7 +2002,7 @@ def local_alloc_unary(node):
# Is it really necessary to copy over stack trace here?
# after all, T.alloc and T.cast should preserve the stack trace from x,
# but perhaps the trace is lost in "v = node.op(x)"?
copy_stack_trace
(
node
.
outputs
[
0
],
ret
)
copy_stack_trace
(
[
node
.
outputs
[
0
],
a
],
ret
)
return
[
ret
]
...
...
@@ -2560,12 +2561,12 @@ def local_subtensor_lift(node):
idx
=
node
.
inputs
[
1
:]
x_idx
=
node
.
op
(
u
.
owner
.
inputs
[
0
],
*
idx
)
# Copy over previous output stacktrace
# Julian: Would it make more sense to copy stacktace before opt is applied, i.e. from u.owner.inputs[0]?
copy_stack_trace
(
node
.
outputs
,
x_idx
)
ret
=
u
.
owner
.
op
(
x_idx
)
# Copy over previous output stacktrace
copy_stack_trace
(
node
.
outputs
,
ret
)
return
[]
# and stacktrace from previous unary operation
copy_stack_trace
([
node
.
outputs
,
node
.
inputs
[
0
]],
ret
)
return
[
ret
]
if
isinstance
(
u
.
owner
.
op
,
T
.
Elemwise
):
new_inputs
=
[]
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论