提交 969044a7 authored 作者: Frederic Bastien's avatar Frederic Bastien

better error message

上级 3b0f4cdb
...@@ -5919,7 +5919,11 @@ def local_merge_alloc(node): ...@@ -5919,7 +5919,11 @@ def local_merge_alloc(node):
if isinstance(dim_inner, Constant) and dim_inner.data == 1: if isinstance(dim_inner, Constant) and dim_inner.data == 1:
pass pass
else: else:
dims_outer[-1 - i] = assert_op(dim_outer, dims_outer[-1 - i] = Assert(
T.eq(dim_outer, dim_inner)) "You have a shape error in your graph. To see a better"
" error message and a stack trace of where in your code"
" the error is created, use the Theano flags"
" optimizer=None or optimizer=fast_compile.")(
dim_outer, T.eq(dim_outer, dim_inner))
i += 1 i += 1
return [T.alloc(inputs_inner[0], *dims_outer)] return [T.alloc(inputs_inner[0], *dims_outer)]
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论