Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
66d34ebe
提交
66d34ebe
authored
3月 13, 2021
作者:
Brandon T. Willard
提交者:
Brandon T. Willard
3月 18, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix misc. message formatting and grammar mistakes
上级
6700dcdf
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
20 行增加
和
17 行删除
+20
-17
utils.py
aesara/link/utils.py
+17
-14
elemwise.py
aesara/tensor/elemwise.py
+3
-3
没有找到文件。
aesara/link/utils.py
浏览文件 @
66d34ebe
...
...
@@ -330,9 +330,9 @@ def raise_with_op(
else
:
scalar_values
.
append
(
"not shown"
)
else
:
shapes
=
"The thunk do
n't have an inputs
attributes."
strides
=
"So we can't access the strides of
inputs
values"
scalar_values
=
"
And can't print its inputs scalar value
"
shapes
=
"The thunk do
esn't have an `inputs`
attributes."
strides
=
"So we can't access the strides of
the input
values"
scalar_values
=
"
and we can't print its scalar input values
"
clients
=
[[
c
[
0
]
for
c
in
fgraph
.
clients
[
var
]]
for
var
in
node
.
outputs
]
detailed_err_msg
+=
(
f
"Inputs shapes: {shapes}"
...
...
@@ -349,14 +349,15 @@ def raise_with_op(
detailed_err_msg
+=
f
"
\n
Outputs clients: {clients}
\n
"
else
:
hints
.
append
(
"HINT: Use a
nother linker then the c
linker to"
"
have the inputs shapes and strides printed
."
"HINT: Use a
linker other than the C
linker to"
"
print the inputs' shapes and strides
."
)
# Print node backtraces
tr
=
getattr
(
node
.
outputs
[
0
]
.
tag
,
"trace"
,
[])
if
isinstance
(
tr
,
list
)
and
len
(
tr
)
>
0
:
detailed_err_msg
+=
"
\n
Backtrace when the node is created(use Aesara flag traceback__limit=N to make it longer):
\n
"
detailed_err_msg
+=
"
\n
Backtrace when the node is created "
detailed_err_msg
+=
"(use Aesara flag traceback__limit=N to make it longer):
\n
"
# Print separate message for each element in the list of batcktraces
sio
=
io
.
StringIO
()
...
...
@@ -365,9 +366,9 @@ def raise_with_op(
detailed_err_msg
+=
str
(
sio
.
getvalue
())
else
:
hints
.
append
(
"HINT: Re-running with most Aesara optimization disabled could"
"
give you a back-trace of
when this node was created. This can"
" be done
with
by setting the Aesara flag"
"HINT: Re-running with most Aesara optimization
s
disabled could"
"
provide a back-trace showing
when this node was created. This can"
" be done by setting the Aesara flag"
" 'optimizer=fast_compile'. If that does not work,"
" Aesara optimizations can be disabled with 'optimizer=None'."
)
...
...
@@ -378,7 +379,7 @@ def raise_with_op(
f
=
io
.
StringIO
()
aesara
.
printing
.
debugprint
(
node
,
file
=
f
,
stop_on_name
=
True
,
print_type
=
True
)
detailed_err_msg
+=
"
\n
Debugprint of the apply node:
\n
"
detailed_err_msg
+=
"
\n
Debug
print of the apply node:
\n
"
detailed_err_msg
+=
f
.
getvalue
()
# Prints output_map
...
...
@@ -497,8 +498,8 @@ def raise_with_op(
else
:
hints
.
append
(
"HINT: Use the Aesara flag
'exception_verbosity=high'
"
" for a debug
print and storage map footprint of this a
pply node."
"HINT: Use the Aesara flag
`exception_verbosity=high`
"
" for a debug
print-out and storage map footprint of this A
pply node."
)
try
:
...
...
@@ -506,7 +507,9 @@ def raise_with_op(
str
(
exc_value
)
+
detailed_err_msg
+
"
\n
"
+
"
\n
"
.
join
(
hints
)
)
except
TypeError
:
warnings
.
warn
(
f
"{exc_type} error does not allow us to add extra error message"
)
warnings
.
warn
(
f
"{exc_type} error does not allow us to add an extra error message"
)
# Some exception need extra parameter in inputs. So forget the
# extra long error message in that case.
raise
exc_value
.
with_traceback
(
exc_trace
)
...
...
@@ -541,7 +544,7 @@ def __log_thunk_trace(value, handler: io.TextIOWrapper):
write
(
line
)
write
(
"For the full definition stack trace set"
" the Aesara flags
traceback__limit
to -1"
" the Aesara flags
`traceback__limit`
to -1"
)
...
...
aesara/tensor/elemwise.py
浏览文件 @
66d34ebe
...
...
@@ -409,7 +409,7 @@ second dimension
def
get_output_info
(
self
,
dim_shuffle
,
*
inputs
):
"""Return the outputs dtype and broadcastable pattern and the
dimshuffled
ni
puts.
dimshuffled
in
puts.
"""
shadow
=
self
.
scalar_op
.
make_node
(
...
...
@@ -857,9 +857,9 @@ second dimension
return
rval
def
_c_all
(
self
,
node
,
nodename
,
inames
,
onames
,
sub
):
# Some
ops call directly the Elemwise._c_all or Elemwise.c_code
# Some
`Op`s directly call `Elemwise._c_all` or `Elemwise.c_code`
# To not request all of them to call prepare_node(), do it here.
# There is no harm if it get called multi
le time
.
# There is no harm if it get called multi
ple times
.
if
not
hasattr
(
node
.
tag
,
"fake_node"
):
self
.
prepare_node
(
node
,
None
,
None
,
"c"
)
_inames
=
inames
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论