提交 251889e4 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Add a more precise error message for shape mismatches with a possible solution.

上级 903a1183
...@@ -1432,8 +1432,17 @@ class Scan(PureOp): ...@@ -1432,8 +1432,17 @@ class Scan(PureOp):
output_reused = False output_reused = False
if not output_reused: if not output_reused:
try:
outs[j][0][pos[j]] = \ outs[j][0][pos[j]] = \
output_storage[offset_out + j].storage[0] output_storage[offset_out + j].storage[0]
except ValueError as e:
ne = ValueError(
"An output of the scan has changed shape. "
"This may be caused by a pushout optimization."
" Try adding "
"'optimizer_excluding=scanOp_pushout_output' "
"to your Theano flags.")
raise_from(ne, e)
# 5.5 Copy over the values for nit_sot outputs # 5.5 Copy over the values for nit_sot outputs
begin = end begin = end
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论