diff --git a/paddle/fluid/operators/modified_huber_loss_op.h b/paddle/fluid/operators/modified_huber_loss_op.h index d6dd5539af018c171c7ae00b945f7cfc858b7903..17621095c492519d80ba23475b94ba6176e9a817 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)); } };