Commit 808a6be5 authored by Sebastian N.'s avatar Sebastian N.
Browse files

Fixed another bug in BeamSearch

parent 5f9884ec
Pipeline #203333 failed with stages
in 19 seconds
......@@ -59,7 +59,7 @@
sort(topk.begin(), topk.end(), [] (const pair<int, float>& p1, const pair<int, float>& p2) {
return p1.second > p2.second;
};
topk = vector<pair<int, float>>(topk.begin(), topk.begin() + std::min(k, topk.size()));
topk = vector<pair<int, float>>(topk.begin(), topk.begin() + std::min<int>(k, topk.size()));
for (const pair<int, float>& pair : topk) {
vector<vector<float>> currentSeq = seq;
......@@ -71,7 +71,7 @@
sort(allCandidates.begin(), allCandidates.end(), [] (const pair<vector<vector<float>>, double>& p1, const pair<vector<vector<float>>, double>& p2) {
return p1.second > p2.second;
});
sequences = vector<pair<vector<vector<float>>, double>>(allCandidates.begin(), allCandidates.begin() + std::min(k, allCandidates.size()));
sequences = vector<pair<vector<vector<float>>, double>>(allCandidates.begin(), allCandidates.begin() + std::min<int>(k, allCandidates.size()));
}
for (size_t i = 1; i < ${tc.getBeamSearchMaxLength(networkInstruction)}; ++i) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment