PR #3279 - assert instead of reporting error to std::cerr

This commit is contained in:
godeffroy 2020-08-31 09:38:54 +02:00
parent 78c4ef17b1
commit 59c73f1c46

View File

@ -96,11 +96,7 @@ DecoderState::next(const double *probs,
if (full_beam && log_prob_c + prefix->score < min_cutoff) { if (full_beam && log_prob_c + prefix->score < min_cutoff) {
break; break;
} }
if (!prefix->is_empty() && prefix->timesteps.empty()) { assert(prefix->is_empty() || !prefix->timesteps.empty());
// This should never happen. But we report it if it does.
std::cerr<<"error: non-empty prefix has empty timestep sequence"<<std::endl;
continue;
}
// blank // blank
if (c == blank_id_) { if (c == blank_id_) {