diff --git a/python/paddle/nn/functional/loss.py b/python/paddle/nn/functional/loss.py index bef604778ab1d51b71ec24e9fd179c7d35c3a828..2fce7000927094a9db562ecc0f3405ffe5aca901 100755 --- a/python/paddle/nn/functional/loss.py +++ b/python/paddle/nn/functional/loss.py @@ -1275,7 +1275,8 @@ def cross_entropy(input, fluid.data_feeder.check_variable_and_dtype( input, 'input', ['float32', 'float64'], 'softmax_cross_entropy') fluid.data_feeder.check_variable_and_dtype( - label, 'label', ['int32', 'int64'], 'softmax_cross_entropy') + label, 'label', ['int32', 'int64', 'float32', 'float64'], + 'softmax_cross_entropy') out = softmax_with_cross_entropy( input, label,