未验证 提交 f5ca2db2 编写于 作者: C chajchaj 提交者: GitHub

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
上级 52edaecc
...@@ -1275,7 +1275,8 @@ def cross_entropy(input, ...@@ -1275,7 +1275,8 @@ def cross_entropy(input,
fluid.data_feeder.check_variable_and_dtype( fluid.data_feeder.check_variable_and_dtype(
input, 'input', ['float32', 'float64'], 'softmax_cross_entropy') input, 'input', ['float32', 'float64'], 'softmax_cross_entropy')
fluid.data_feeder.check_variable_and_dtype( 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( out = softmax_with_cross_entropy(
input, input,
label, label,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册