Skip to content

Commit 7b03daf

Browse files
authored
Fix loop variable in token search for top_k indices
1 parent 2ce8328 commit 7b03daf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

test/sampling_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,8 +697,8 @@ TEST(SamplingTests, RandomizedSamplingSelectTopCuda_BatchSize1_LargeVocabSize) {
697697

698698
// Next token has to be in the list of the above top_k indices
699699
bool found = false;
700-
for (int i = 0; i < top_k; ++i) {
701-
if (indices[i] == next_token) {
700+
for (int k = 0; k < top_k; ++k) {
701+
if (indices[k] == next_token) {
702702
found = true;
703703
break;
704704
}

0 commit comments

Comments
 (0)