Update celoss.py
parent
e5771019e5
commit
2e41b5de5e
|
@ -51,7 +51,6 @@ class CELoss(nn.Layer):
|
||||||
loss = paddle.sum(x * label, axis=-1)
|
loss = paddle.sum(x * label, axis=-1)
|
||||||
else:
|
else:
|
||||||
if label.shape[-1] == x.shape[-1]:
|
if label.shape[-1] == x.shape[-1]:
|
||||||
label = F.softmax(label, axis=-1)
|
|
||||||
soft_label = True
|
soft_label = True
|
||||||
else:
|
else:
|
||||||
soft_label = False
|
soft_label = False
|
||||||
|
|
Loading…
Reference in New Issue