fix topk bug which cause ctc score diff

pull/2524/head
Hui Zhang 3 years ago
parent 7e334ce890
commit 64cb4048a8

@ -79,11 +79,13 @@ void TopK(const std::vector<T>& data,
int cur = values->size() - 1;
while (!pq.empty()) {
const auto& item = pq.top();
pq.pop();
(*values)[cur] = item.first;
(*indices)[cur] = item.second;
// item if reference, must pop here
pq.pop();
cur--;
}
}

Loading…
Cancel
Save