提交 792ee655 authored 作者: Joseph Turian's avatar Joseph Turian

Improved error message

上级 39198a72
......@@ -180,7 +180,7 @@ class Tensor(Type):
else:
data = numpy.asarray(data, dtype = self.dtype)
if not self.ndim == data.ndim:
raise TypeError("Wrong number of dimensions: expected %s, got %s." % (self.ndim, data.ndim), _data)
raise TypeError("Wrong number of dimensions: expected %s, got %s with shape %s." % (self.ndim, data.ndim, data.shape), data)
if any(b and d != 1 for d, b in zip(data.shape, self.broadcastable)):
raise TypeError("Non-unit value on shape on a broadcastable dimension.", data.shape, self.broadcastable)
return data
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论