Skip to content

Commit 6139d2a

Browse files
authored
Bump Elixir requirement to v1.15 (#1483)
1 parent d55faa1 commit 6139d2a

File tree

5 files changed

+43
-40
lines changed

5 files changed

+43
-40
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
working_directory: ["nx", "exla", "torchx"]
15-
elixir: ["1.14.5", "1.15.4"]
15+
elixir: ["1.15.4", "1.16.2"]
1616
otp: ["25.3"]
1717
include:
18-
- elixir: "1.15.4"
18+
- elixir: "1.16.2"
1919
lint: true
2020
defaults:
2121
run:
@@ -57,7 +57,7 @@ jobs:
5757
fail-fast: false
5858
matrix:
5959
working_directory: ["nx", "torchx"]
60-
elixir: ["1.14.5"]
60+
elixir: ["1.16.2"]
6161
otp: ["25.2"]
6262
defaults:
6363
run:

exla/mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ defmodule EXLA.MixProject do
1111
[
1212
app: :exla,
1313
version: @version,
14-
elixir: "~> 1.14",
14+
elixir: "~> 1.15",
1515
elixirc_paths: elixirc_paths(Mix.env()),
1616
deps: deps(),
1717
docs: docs(),

nx/mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ defmodule Nx.MixProject do
1212
[
1313
app: :nx,
1414
version: @version,
15-
elixir: "~> 1.14",
15+
elixir: "~> 1.15",
1616
elixirc_paths: elixirc_paths(Mix.env()),
1717
deps: deps(),
1818
docs: docs(),

nx/test/nx/lin_alg_test.exs

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -566,40 +566,43 @@ defmodule Nx.LinAlgTest do
566566
])
567567
end
568568

569-
test "computes eigenvalues and eigenvectors for a Hermitian matrix case" do
570-
# Hermitian matrix
571-
t =
572-
Nx.tensor([
573-
[1, Complex.new(0, 2), 2],
574-
[Complex.new(0, -2), -3, Complex.new(0, 2)],
575-
[2, Complex.new(0, -2), 1]
576-
])
577-
578-
assert {eigenvals, eigenvecs} = Nx.LinAlg.eigh(t, max_iter: 10_000)
579-
580-
# Eigenvalues
581-
assert eigenvals ==
582-
Nx.tensor([Complex.new(-5, 0), Complex.new(3, 0), Complex.new(1, 0)])
583-
584-
# Eigenvectors
585-
assert round(eigenvecs, 3) ==
586-
Nx.tensor([
587-
[
588-
Complex.new(-0.408, 0.0),
589-
Complex.new(-0.0, 0.707),
590-
Complex.new(0.577, 0.0)
591-
],
592-
[
593-
Complex.new(-0.0, -0.816),
594-
Complex.new(0.0, 0.0),
595-
Complex.new(0.0, -0.577)
596-
],
597-
[
598-
Complex.new(0.408, 0.0),
599-
Complex.new(-0.0, 0.707),
600-
Complex.new(-0.577, 0.0)
601-
]
602-
])
569+
# TODO: Remove conditional once we require 1.16+
570+
if Version.match?(System.version(), "~> 1.16") do
571+
test "computes eigenvalues and eigenvectors for a Hermitian matrix case" do
572+
# Hermitian matrix
573+
t =
574+
Nx.tensor([
575+
[1, Complex.new(0, 2), 2],
576+
[Complex.new(0, -2), -3, Complex.new(0, 2)],
577+
[2, Complex.new(0, -2), 1]
578+
])
579+
580+
assert {eigenvals, eigenvecs} = Nx.LinAlg.eigh(t, max_iter: 10_000)
581+
582+
# Eigenvalues
583+
assert eigenvals ==
584+
Nx.tensor([Complex.new(-5, 0), Complex.new(3, 0), Complex.new(1, 0)])
585+
586+
# Eigenvectors
587+
assert round(eigenvecs, 3) ==
588+
Nx.tensor([
589+
[
590+
Complex.new(-0.408, 0.0),
591+
Complex.new(-0.0, 0.707),
592+
Complex.new(0.577, 0.0)
593+
],
594+
[
595+
Complex.new(-0.0, -0.816),
596+
Complex.new(0.0, 0.0),
597+
Complex.new(0.0, -0.577)
598+
],
599+
[
600+
Complex.new(0.408, 0.0),
601+
Complex.new(-0.0, 0.707),
602+
Complex.new(-0.577, 0.0)
603+
]
604+
])
605+
end
603606
end
604607

605608
test "properties for matrices with different eigenvalues" do

torchx/mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ defmodule Torchx.MixProject do
1010
[
1111
app: :torchx,
1212
version: @version,
13-
elixir: "~> 1.14",
13+
elixir: "~> 1.15",
1414
elixirc_paths: elixirc_paths(Mix.env()),
1515
deps: deps(),
1616
docs: docs(),

0 commit comments

Comments
 (0)