support label with float input of cross_entropy, test=develop (#30929)

* support label with float input of cross_entropy, test=develop

* fix code style in nn/functional/loss.py, test=develop
revert-31068-fix_conv3d_windows
chajchaj 4 years ago committed by GitHub
parent 52edaecc5d
commit f5ca2db2cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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,

Loading…
Cancel
Save