From 9ddde1d41f01ee6fbdfd1b2e8cd7a63190db4119 Mon Sep 17 00:00:00 2001 From: Gonzalo <456459+grzuy@users.noreply.github.com> Date: Wed, 1 Nov 2023 14:16:17 -0300 Subject: [PATCH] test: all/1 --- test/candlex_test.exs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/candlex_test.exs b/test/candlex_test.exs index 111e86f..31c5ad2 100644 --- a/test/candlex_test.exs +++ b/test/candlex_test.exs @@ -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})