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

Better error message

上级 b7555094
...@@ -140,7 +140,8 @@ class DimShuffle(Op): ...@@ -140,7 +140,8 @@ class DimShuffle(Op):
# numpy integers. See # numpy integers. See
# <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("DimShuffle indices must be python ints.") raise TypeError(
"DimShuffle indices must be python ints. Got: ", 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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论