fix assert,test=develop (#17445)

resnext-opt
Bai Yifan 6 years ago committed by GitHub
parent b02f2aff04
commit 3a9ae28d32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -154,9 +154,9 @@ struct HardLabelCrossEntropyForwardFunctor {
HOSTDEVICE void operator()(int64_t idx) const {
auto label = label_[idx];
PADDLE_ASSERT_MSG(label >= 0 && label < feature_size_,
"The label is out of the range.", label);
if (label != ignore_index_) {
PADDLE_ASSERT_MSG(label >= 0 && label < feature_size_,
"The label is out of the range.", label);
auto match_x = x_[idx * feature_size_ + label];
y_[idx] = -math::TolerableValue<T>()(real_log(match_x));
match_x_[idx] = match_x;

Loading…
Cancel
Save