Skip to content

Commit

Permalink
increase temporarily size of stack
Browse files Browse the repository at this point in the history
  • Loading branch information
msluszniak committed Mar 8, 2024
1 parent 790ea21 commit 62b357b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/scholar/neighbors/nn_descent.ex
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ defmodule Scholar.Neighbors.NNDescent do

# Normally there would be a stack of that will dynamically grow
# so we need to preallocate it with a fixed size
expand_factor = 50
expand_factor = 150
updates_indices = Nx.broadcast(Nx.s64(0), {expand_factor * num_samples, 2})

updates_dist =
Expand Down Expand Up @@ -1038,7 +1038,7 @@ defmodule Scholar.Neighbors.NNDescent do
initial_candidates, initial_distances, train_data, rng_key, i = 0},
i < num_heaps do
visited = Nx.broadcast(Nx.u8(0), {train_data_size})
expand_factor = 50
expand_factor = 150
search_candidates_indices = Nx.broadcast(Nx.s64(-1), {num_nodes * expand_factor})

search_candidates_distances =
Expand Down

0 comments on commit 62b357b

Please sign in to comment.