refine Error message of modified_huber_loss (#24417)

* refine Error message of modified_huber_loss, test=develop

* refine Error message style, test=develop
release/2.0-alpha
huangjun12 5 years ago committed by GitHub
parent 78af4c9966
commit 046b7ebc03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -29,10 +29,12 @@ using EigenVector = framework::EigenVector<T, MajorType, IndexType>;
template <typename T>
struct CheckLabelValue {
HOSTDEVICE T operator()(const T& val) const {
PADDLE_ENFORCE(val == static_cast<T>(0) || val == static_cast<T>(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<T>(0) || val == static_cast<T>(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));
}
};

Loading…
Cancel
Save