未验证 提交 457cf826 编写于 作者: H huangjun12 提交者: GitHub

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
上级 9fe93b15
......@@ -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));
}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册