提交 08a86b37 authored 作者: Dario Garcia's avatar Dario Garcia

Update nnet.py

Proper string representation of the error
上级 85159185
...@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论