Skip to content

Commit 457cf82

Browse files
authored
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
1 parent 9fe93b1 commit 457cf82

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

paddle/fluid/operators/modified_huber_loss_op.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ using EigenVector = framework::EigenVector<T, MajorType, IndexType>;
2929
template <typename T>
3030
struct CheckLabelValue {
3131
HOSTDEVICE T operator()(const T& val) const {
32-
PADDLE_ENFORCE(val == static_cast<T>(0) || val == static_cast<T>(1),
33-
"LabelValue of modified_huber_loss_op expected to be 0 "
34-
"or 1, but got %ld. Please check input value.",
35-
val);
32+
PADDLE_ENFORCE(
33+
val == static_cast<T>(0) || val == static_cast<T>(1),
34+
platform::errors::InvalidArgument(
35+
"Input(label) value of modified_huber_loss_op expected to be 0 "
36+
"or 1, but got %ld. Please check label value.",
37+
val));
3638
}
3739
};
3840

0 commit comments

Comments
 (0)