Skip to content

Commit

Permalink
test: Nx.slice/3 with tensors as start_indices
Browse files Browse the repository at this point in the history
  • Loading branch information
grzuy committed Nov 17, 2023
1 parent c13ab7e commit 9677568
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/candlex_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -1824,6 +1824,18 @@ defmodule CandlexTest do
# [5, 6]
# ]
# ))

t([0, 1])
|> Nx.slice([t(0)], [1])
|> assert_equal(t([0]))

t([0, 1])
|> Nx.slice([t(1)], [1])
|> assert_equal(t([1]))

t([[1, 2, 3], [4, 5, 6]])
|> Nx.slice([t(0), t(1)], [1, 1])
|> assert_equal(t([[2]]))
end

test "squeeze" do
Expand Down

0 comments on commit 9677568

Please sign in to comment.