提交 3675f25d 编写于 作者: H HydrogenSulfate 提交者: chajchaj

Update loss.py

上级 53dc0143
......@@ -1670,7 +1670,8 @@ def cross_entropy(input,
# to detect and find out possible illegal label values
if len(paddle.nonzero(valid_label >= input.shape[axis])) > 0:
invalid_label = paddle.gather_nd(
valid_label, paddle.nonzero(valid_label >= input.shape[axis]))
valid_label,
paddle.nonzero(valid_label >= input.shape[axis]))
raise ValueError(
"Target({}) is out of class_dimension's upper bound({})".
format(invalid_label[0], input.shape[axis] - 1))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册