diff --git a/python/paddle/nn/functional/loss.py b/python/paddle/nn/functional/loss.py index a441183ca82344ddbdfc4a3e02501408666a9101..9930b09780dc08ea57c52f871fd26218e4f021f5 100644 --- a/python/paddle/nn/functional/loss.py +++ b/python/paddle/nn/functional/loss.py @@ -2601,7 +2601,7 @@ def cross_entropy( "npu" ) or core.is_compiled_with_custom_device("mlu"): if not soft_label: - _, _, out = _legacy_C_ops.softmax_with_cross_entropy( + _, out = _legacy_C_ops.softmax_with_cross_entropy( input, valid_label, 'soft_label', @@ -2616,7 +2616,7 @@ def cross_entropy( use_softmax, ) else: - _, _, out = _legacy_C_ops.softmax_with_cross_entropy( + _, out = _legacy_C_ops.softmax_with_cross_entropy( input, label, 'soft_label',