From f36c4da5ca2f125c1c9b7484161c96ae39b18b8b Mon Sep 17 00:00:00 2001 From: feifei-111 Date: Thu, 18 Aug 2022 14:51:51 +0800 Subject: [PATCH] add float16 (#45216) --- python/paddle/nn/functional/loss.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/paddle/nn/functional/loss.py b/python/paddle/nn/functional/loss.py index 3a9dd595387..004070d23c6 100755 --- a/python/paddle/nn/functional/loss.py +++ b/python/paddle/nn/functional/loss.py @@ -2416,7 +2416,7 @@ def cross_entropy(input, out = paddle.squeeze(out, axis=axis) return out - check_variable_and_dtype(input, 'input', ['float32', 'float64'], + check_variable_and_dtype(input, 'input', ['float16', 'float32', 'float64'], 'softmax_cross_entropy') check_variable_and_dtype( label, 'label', -- GitLab