Skip to content

Commit

Permalink
Add amendments
Browse files Browse the repository at this point in the history
  • Loading branch information
msluszniak committed Nov 23, 2023
1 parent 42613ac commit 5ca98ef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/scholar/neighbors/kd_tree.ex
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ defmodule Scholar.Neighbors.KDTree do
recur(rest, next, acc, tensor, level, levels, opts)
end

defp recur([{i, indexes} | rest], next, acc, tensor, level, levels, opts) do
defp recur([{i, indices} | rest], next, acc, tensor, level, levels, opts) do
%Nx.Tensor{shape: {size, dims}} = tensor
k = rem(level, dims)
subtree_size = unbounded_subtree_size(left_child(i), levels, size)

{left, mid, right} =
Nx.Defn.jit_apply(&recur_slice(&1, &2, &3, subtree_size), [tensor, indexes, k], opts)
Nx.Defn.jit_apply(&recur_slice(&1, &2, &3, subtree_size), [tensor, indices, k], opts)

next = [{right_child(i), right}, {left_child(i), left} | next]
acc = <<acc::binary, Nx.to_number(mid)::32-unsigned-native-integer>>
Expand Down Expand Up @@ -423,7 +423,7 @@ defmodule Scholar.Neighbors.KDTree do
distances = Nx.broadcast(Nx.Constants.infinity(), {k})
visited = Nx.broadcast(Nx.u8(0), {size})

indices = tree.indexes |> Nx.as_type(:s64)
indices = tree.indices |> Nx.as_type(:s64)
data = tree.data

down = 0
Expand Down

0 comments on commit 5ca98ef

Please sign in to comment.