From 3568a99c5f6ff0e5fd528d43bd283fde34fe078b Mon Sep 17 00:00:00 2001 From: Aditya Raj <109805994+zeus2x7@users.noreply.github.com> Date: Mon, 28 Aug 2023 15:23:18 +0530 Subject: [PATCH] Update loss.py --refactored fluid_softmax_with_cross_entropy (#56686) * Update loss.py --refactored fluid_softmax_with_cross_entropy * Update loss.py --- python/paddle/nn/functional/loss.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/paddle/nn/functional/loss.py b/python/paddle/nn/functional/loss.py index 655fc8d5b7c..beb12e2a08d 100644 --- a/python/paddle/nn/functional/loss.py +++ b/python/paddle/nn/functional/loss.py @@ -256,13 +256,13 @@ def fluid_softmax_with_cross_entropy( """ input_dims = len(list(logits.shape)) if input_dims == 0: - raise ValueError('The dimention of input should be larger than zero!') + raise ValueError('The dimension of input should be larger than zero!') label_dims = len(list(label.shape)) if input_dims - 1 != label_dims and input_dims != label_dims: raise ValueError( - 'Expected nput_dims - 1 = label_dims or input_dims == label_dims\ - (got nput_dims{}, label_dims{})'.format( + 'Expected input_dims - 1 = label_dims or input_dims == label_dims\ + (got input_dims{}, label_dims{})'.format( input_dims, label_dims ) ) -- GitLab