Skip to content

Commit

Permalink
chore: update complex dependency (#1568)
Browse files Browse the repository at this point in the history
  • Loading branch information
polvalente authored Jan 9, 2025
1 parent f0b3f10 commit 73526ed
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion nx/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ defmodule Nx.MixProject do

defp deps do
[
{:complex, "~> 0.5"},
{:complex, "~> 0.6"},
{:telemetry, "~> 0.4.0 or ~> 1.0"},
{:ex_doc, "~> 0.29", only: :docs}
]
Expand Down
2 changes: 1 addition & 1 deletion nx/mix.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%{
"complex": {:hex, :complex, "0.5.0", "af2d2331ff6170b61bb738695e481b27a66780e18763e066ee2cd863d0b1dd92", [:mix], [], "hexpm", "2683bd3c184466cfb94fad74cbfddfaa94b860e27ad4ca1bffe3bff169d91ef1"},
"complex": {:hex, :complex, "0.6.0", "b0130086a7a8c33574d293b2e0e250f4685580418eac52a5658a4bd148f3ccf1", [:mix], [], "hexpm", "0a5fa95580dcaf30fcd60fe1aaf24327c0fe401e98c24d892e172e79498269f9"},
"earmark_parser": {:hex, :earmark_parser, "1.4.41", "ab34711c9dc6212dda44fcd20ecb87ac3f3fce6f0ca2f28d4a00e4154f8cd599", [:mix], [], "hexpm", "a81a04c7e34b6617c2792e291b5a2e57ab316365c2644ddc553bb9ed863ebefa"},
"ex_doc": {:hex, :ex_doc, "0.34.2", "13eedf3844ccdce25cfd837b99bea9ad92c4e511233199440488d217c92571e8", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "5ce5f16b41208a50106afed3de6a2ed34f4acfd65715b82a0b84b49d995f95c1"},
"makeup": {:hex, :makeup, "1.1.2", "9ba8837913bdf757787e71c1581c21f9d2455f4dd04cfca785c70bbfff1a76a3", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cce1566b81fbcbd21eca8ffe808f33b221f9eee2cbc7a1706fc3da9ff18e6cac"},
Expand Down
11 changes: 5 additions & 6 deletions nx/test/nx/non_finite_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,18 @@ defmodule Nx.NonFiniteTest do
@arg Complex.new(:infinity, 3)
@arg2 Complex.new(-2, 4)

@inf_inf Complex.new(:infinity, :infinity)
@nan_nan Complex.new(:nan, :nan)

@one Nx.tensor(1, type: {:u, 8})
@zero Nx.tensor(0, type: {:u, 8})

describe "unary operations" do
test "exp" do
assert Nx.exp(@arg) == Nx.tensor(@inf_inf)
assert Nx.exp(@arg) == Nx.tensor(Complex.new(:neg_infinity, :infinity))
end

test "expm1" do
assert Nx.expm1(@arg) == Nx.tensor(@inf_inf)
assert Nx.expm1(@arg) == Nx.tensor(Complex.new(:neg_infinity, :infinity))
end

test "log" do
Expand Down Expand Up @@ -51,11 +50,11 @@ defmodule Nx.NonFiniteTest do
end

test "cosh" do
assert Nx.cosh(@arg) == Nx.tensor(@inf_inf)
assert Nx.cosh(@arg) == Nx.tensor(Complex.new(:neg_infinity, :infinity))
end

test "sinh" do
assert Nx.sinh(@arg) == Nx.tensor(@inf_inf)
assert Nx.sinh(@arg) == Nx.tensor(Complex.new(:neg_infinity, :infinity))
end

test "tanh" do
Expand Down Expand Up @@ -145,7 +144,7 @@ defmodule Nx.NonFiniteTest do
end

test "product" do
assert Nx.product(Nx.tensor([@arg, @arg2])) == Nx.multiply(@arg, @arg2)
assert Nx.product(Nx.tensor([@arg, @arg2])) == Nx.tensor(Complex.new(:nan, :nan))
assert Nx.product(Nx.tensor(:infinity)) == Nx.tensor(:infinity)
end

Expand Down

0 comments on commit 73526ed

Please sign in to comment.