提交 e3b6f601 authored 作者: Frederic Bastien's avatar Frederic Bastien

Better error message

上级 cb11961c
...@@ -141,7 +141,9 @@ class DimShuffle(Op): ...@@ -141,7 +141,9 @@ class DimShuffle(Op):
# <http://projects.scipy.org/numpy/ticket/2235>. # <http://projects.scipy.org/numpy/ticket/2235>.
if not isinstance(j, (integer_types, numpy.integer)): if not isinstance(j, (integer_types, numpy.integer)):
raise TypeError( raise TypeError(
"DimShuffle indices must be python ints. Got: ", j) "DimShuffle indices must be python ints. "
"Got: '%s' of type '%s'.",
str(j), str(type(j)))
if j >= len(input_broadcastable): if j >= len(input_broadcastable):
raise ValueError(("new_order[%d] is %d, but the input " raise ValueError(("new_order[%d] is %d, but the input "
"only has %d axes.") % "only has %d axes.") %
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论