Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
30c3ed89
提交
30c3ed89
authored
7月 13, 2016
作者:
Iulian Vlad Serban
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update on merged work for #4659
上级
95fba1b6
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
14 行增加
和
6 行删除
+14
-6
fg.py
theano/gof/fg.py
+1
-1
link.py
theano/gof/link.py
+1
-1
opt.py
theano/gof/opt.py
+8
-0
opt.py
theano/tensor/opt.py
+4
-4
没有找到文件。
theano/gof/fg.py
浏览文件 @
30c3ed89
...
@@ -53,7 +53,7 @@ class MissingInputError(Exception):
...
@@ -53,7 +53,7 @@ class MissingInputError(Exception):
# The call to list is needed for Python 3
# The call to list is needed for Python 3
assert
list
(
kwargs
.
keys
())
==
[
"variable"
]
assert
list
(
kwargs
.
keys
())
==
[
"variable"
]
tr
=
getattr
(
list
(
kwargs
.
values
())[
0
]
.
tag
,
'trace'
,
[])
tr
=
getattr
(
list
(
kwargs
.
values
())[
0
]
.
tag
,
'trace'
,
[])
if
type
(
tr
)
is
list
and
len
(
tr
)
>
0
:
if
isinstance
(
tr
,
list
)
is
list
and
len
(
tr
)
>
0
:
sio
=
StringIO
()
sio
=
StringIO
()
print
(
"
\n
Backtrace when the variable is created:"
,
file
=
sio
)
print
(
"
\n
Backtrace when the variable is created:"
,
file
=
sio
)
for
subtr
in
list
(
kwargs
.
values
())[
0
]
.
tag
.
trace
:
for
subtr
in
list
(
kwargs
.
values
())[
0
]
.
tag
.
trace
:
...
...
theano/gof/link.py
浏览文件 @
30c3ed89
...
@@ -179,7 +179,7 @@ def raise_with_op(node, thunk=None, exc_info=None, storage_map=None):
...
@@ -179,7 +179,7 @@ def raise_with_op(node, thunk=None, exc_info=None, storage_map=None):
# Print node backtraces
# Print node backtraces
tr
=
getattr
(
node
.
outputs
[
0
]
.
tag
,
'trace'
,
[])
tr
=
getattr
(
node
.
outputs
[
0
]
.
tag
,
'trace'
,
[])
if
type
(
tr
)
is
list
and
len
(
tr
)
>
0
:
if
isinstance
(
tr
,
list
)
is
list
and
len
(
tr
)
>
0
:
detailed_err_msg
+=
"
\n
Backtrace when the node is created(use Theano flag traceback.limit=N to make it longer):
\n
"
detailed_err_msg
+=
"
\n
Backtrace when the node is created(use Theano flag traceback.limit=N to make it longer):
\n
"
# Print separate message for each element in the list of batcktraces
# Print separate message for each element in the list of batcktraces
...
...
theano/gof/opt.py
浏览文件 @
30c3ed89
...
@@ -3010,9 +3010,17 @@ def check_stack_trace(f_or_fgraph, ops_to_check='last', bug_print='raise'):
...
@@ -3010,9 +3010,17 @@ def check_stack_trace(f_or_fgraph, ops_to_check='last', bug_print='raise'):
else
:
else
:
raise
ValueError
(
'The string bug_print is not recognised'
)
raise
ValueError
(
'The string bug_print is not recognised'
)
print
(
"apply_nodes_to_check"
)
print
(
apply_nodes_to_check
)
for
node
in
apply_nodes_to_check
:
for
node
in
apply_nodes_to_check
:
for
output
in
node
.
outputs
:
for
output
in
node
.
outputs
:
print
(
'Checking node'
)
print
(
node
)
if
(
not
hasattr
(
output
.
tag
,
'trace'
)
or
not
output
.
tag
.
trace
):
if
(
not
hasattr
(
output
.
tag
,
'trace'
)
or
not
output
.
tag
.
trace
):
print
(
'Failed on node'
)
print
(
node
)
#print(node.outputs[0].tag.trace)
#print(node.tag.trace)
return
False
return
False
return
True
return
True
theano/tensor/opt.py
浏览文件 @
30c3ed89
...
@@ -4226,7 +4226,7 @@ def local_flatten_lift(node):
...
@@ -4226,7 +4226,7 @@ def local_flatten_lift(node):
# Copy over stacktrace from previous output node and from unary
# Copy over stacktrace from previous output node and from unary
# elementwise output node since if there was an error, it would
# elementwise output node since if there was an error, it would
# probably have come from that operation.
# probably have come from that operation.
copy_stack_trace
(
node
.
outputs
+
node
.
inputs
[
0
]
,
e
)
copy_stack_trace
(
node
.
outputs
+
node
.
inputs
,
e
)
return
[
e
]
return
[
e
]
...
@@ -5186,7 +5186,7 @@ def local_sum_prod_mul_by_scalar(node):
...
@@ -5186,7 +5186,7 @@ def local_sum_prod_mul_by_scalar(node):
ret
=
T
.
mul
(
*
mul_inputs
)
ret
=
T
.
mul
(
*
mul_inputs
)
# Copy over stacktrace from previous output to new mul op,
# Copy over stacktrace from previous output to new mul op,
# for same reason as above.
# for same reason as above.
copy_stack_trace
(
node
.
outputs
,
ret
+
mul_inputs
)
copy_stack_trace
(
node
.
outputs
,
[
ret
]
+
mul_inputs
)
return
[
ret
]
return
[
ret
]
...
@@ -5196,7 +5196,7 @@ def local_sum_prod_mul_by_scalar(node):
...
@@ -5196,7 +5196,7 @@ def local_sum_prod_mul_by_scalar(node):
# There are never errors in the negative op, thus
# There are never errors in the negative op, thus
# we need only to copy over stacktrace from previous output node to
# we need only to copy over stacktrace from previous output node to
# the two new ops.
# the two new ops.
copy_stack_trace
(
node
.
outputs
,
s
+
ret
)
copy_stack_trace
(
node
.
outputs
,
[
s
,
ret
]
)
return
[
ret
]
return
[
ret
]
...
@@ -5212,8 +5212,8 @@ def local_elemwise_sub_zeros(node):
...
@@ -5212,8 +5212,8 @@ def local_elemwise_sub_zeros(node):
node
.
op
.
scalar_op
==
scalar
.
sub
and
node
.
op
.
scalar_op
==
scalar
.
sub
and
node
.
inputs
[
0
]
==
node
.
inputs
[
1
]):
node
.
inputs
[
0
]
==
node
.
inputs
[
1
]):
res
=
T
.
zeros_like
(
node
.
inputs
[
0
])
res
=
T
.
zeros_like
(
node
.
inputs
[
0
])
# Copy over stacktrace from previous output.
# Copy over stacktrace from previous output.
# Julian: Pascal, is this really necessary? Is there anyway zeros_like can ever fail?
copy_stack_trace
(
node
.
outputs
,
res
)
copy_stack_trace
(
node
.
outputs
,
res
)
return
[
res
]
return
[
res
]
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论