提交 fee78d8c authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #2967 from dg2/patch-1

Proper string representation of a ValueError on Softmax.make_node
...@@ -398,7 +398,7 @@ class Softmax(gof.Op): ...@@ -398,7 +398,7 @@ class Softmax(gof.Op):
x = tensor.as_tensor_variable(x) x = tensor.as_tensor_variable(x)
if x.type.ndim not in (1, 2) \ if x.type.ndim not in (1, 2) \
or x.type.dtype not in tensor.float_dtypes: or x.type.dtype not in tensor.float_dtypes:
raise ValueError('x must be 1-d or 2-d tensor of floats. Got ', raise ValueError('x must be 1-d or 2-d tensor of floats. Got %s' %
x.type) x.type)
if x.ndim == 1: if x.ndim == 1:
x = tensor.shape_padleft(x, n_ones=1) x = tensor.shape_padleft(x, n_ones=1)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论