Skip to content

Commit 840149d

Browse files
authored
using new api cross_entropy. (#573)
1 parent fa1e0ba commit 840149d

File tree

1 file changed

+1
-1
lines changed
  • examples/text_graph/erniesage/models

1 file changed

+1
-1
lines changed

examples/text_graph/erniesage/models/loss.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def __init__(self, config):
4848
super(SoftmaxWithCrossEntropy, self).__init__()
4949

5050
def forward(self, logits, label):
51-
return paddle.mean(F.softmax_with_cross_entropy(logits, label))
51+
return F.cross_entropy(logits, label, reduction="mean")
5252

5353

5454
class HingeLoss(nn.Layer):

0 commit comments

Comments
 (0)