未验证 提交 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>; ...@@ -29,10 +29,12 @@ using EigenVector = framework::EigenVector<T, MajorType, IndexType>;
template <typename T> template <typename T>
struct CheckLabelValue { struct CheckLabelValue {
HOSTDEVICE T operator()(const T& val) const { HOSTDEVICE T operator()(const T& val) const {
PADDLE_ENFORCE(val == static_cast<T>(0) || val == static_cast<T>(1), PADDLE_ENFORCE(
"LabelValue of modified_huber_loss_op expected to be 0 " val == static_cast<T>(0) || val == static_cast<T>(1),
"or 1, but got %ld. Please check input value.", platform::errors::InvalidArgument(
val); "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.
先完成此消息的编辑!
想要评论请 注册