From 457cf82684e88b7aff673740431278d4b3f0615c Mon Sep 17 00:00:00 2001 From: huangjun12 <2399845970@qq.com> Date: Wed, 13 May 2020 18:57:01 +0800 Subject: [PATCH] refine Error message of modified_huber_loss, test=release/1.8 (#24472) * refine Error message of modified_huber_loss, test=develop * refine Error message style, test=develop --- paddle/fluid/operators/modified_huber_loss_op.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/operators/modified_huber_loss_op.h b/paddle/fluid/operators/modified_huber_loss_op.h index d6dd5539af0..17621095c49 100644 --- a/paddle/fluid/operators/modified_huber_loss_op.h +++ b/paddle/fluid/operators/modified_huber_loss_op.h @@ -29,10 +29,12 @@ using EigenVector = framework::EigenVector; template struct CheckLabelValue { HOSTDEVICE T operator()(const T& val) const { - PADDLE_ENFORCE(val == static_cast(0) || val == static_cast(1), - "LabelValue of modified_huber_loss_op expected to be 0 " - "or 1, but got %ld. Please check input value.", - val); + PADDLE_ENFORCE( + val == static_cast(0) || val == static_cast(1), + platform::errors::InvalidArgument( + "Input(label) value of modified_huber_loss_op expected to be 0 " + "or 1, but got %ld. Please check label value.", + val)); } }; -- GitLab