diff --git a/python/paddle/nn/functional/loss.py b/python/paddle/nn/functional/loss.py index 5bb317cf3e746605682ceb2f44146087c74ccf43..eb043c005663a7742118394ff5e9f4a3879c14d7 100755 --- a/python/paddle/nn/functional/loss.py +++ b/python/paddle/nn/functional/loss.py @@ -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))