Skip to content

Commit

Permalink
test: all/1
Browse files Browse the repository at this point in the history
  • Loading branch information
grzuy committed Nov 1, 2023
1 parent 76bc91e commit 9ddde1d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/candlex_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2143,6 +2143,20 @@ defmodule CandlexTest do
)
end

test "all" do
t([0, 1, 2])
|> Nx.all()
|> assert_equal(t(0))

# t([[-1, 0, 1], [2, 3, 4]], names: [:x, :y])
# |> Nx.all(axes: [:x])
# |> assert_equal(t([1, 0, 1]))

# t([[-1, 0, 1], [2, 3, 4]], names: [:x, :y])
# |> Nx.all(axes: [:y])
# |> assert_equal(t([0, 1]))
end

if Candlex.Backend.cuda_available?() do
test "different devices" do
t([1, 2, 3], backend: {Candlex.Backend, device: :cpu})
Expand Down

0 comments on commit 9ddde1d

Please sign in to comment.