Skip to content

Commit

Permalink
commented gather tests with axes
Browse files Browse the repository at this point in the history
  • Loading branch information
grzuy committed Nov 13, 2023
1 parent a0f18aa commit 0ebabd6
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/candlex_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -1639,6 +1639,38 @@ defmodule CandlexTest do
# t([[[1, 2], [11, 12]], [[101, 102], [111, 112]]])
# |> Nx.gather(t([[0, 0, 0], [0, 1, 1], [1, 1, 1]]))
# |> assert_equal(t([1, 12, 112]))

# t([[1, 2, 3], [4, 5, 6]])
# |> Nx.gather(t([[1], [0], [2], [1]]), axes: [1])
# |> assert_equal(t(
# [
# [2, 5],
# [1, 4],
# [3, 6],
# [2, 5]
# ]
# ))

# Nx.iota({2, 1, 3})
# |> Nx.gather(t([[[1], [0], [2]]]), axes: [2])
# |> assert_equal(t(
# [
# [
# [
# [1],
# [4]
# ],
# [
# [0],
# [3]
# ],
# [
# [2],
# [5]
# ]
# ]
# ]
# ))
end

test "indexed_add" do
Expand Down

0 comments on commit 0ebabd6

Please sign in to comment.