Skip to content

Commit

Permalink
fixed zero max batch size bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Magdalen Dobson committed Oct 30, 2023
1 parent 96bed98 commit 74587c5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions algorithms/vamana/index.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ struct knn_index {
float progress_inc = .1;
size_t max_batch_size = std::min(
static_cast<size_t>(max_fraction * static_cast<float>(n)), 1000000ul);
//fix bug where max batch size could be set to zero
if(max_batch_size = 0) max_batch_size = n;
parlay::sequence<int> rperm;
if (random_order)
rperm = parlay::random_permutation<int>(static_cast<int>(m));
Expand Down

0 comments on commit 74587c5

Please sign in to comment.