Skip to content

Commit

Permalink
Do not use EXLA at compile-time (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim authored Aug 30, 2023
1 parent a867449 commit a6e04b0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ jobs:
if: ${{ matrix.lint }}

- run: mix test

- run: USE_EXLA_AT_COMPILE_TIME=1 mix compile --force
4 changes: 4 additions & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import Config

config :exla, :add_backend_on_inspect, config_env() != :test

if System.get_env("USE_EXLA_AT_COMPILE_TIME") do
config :nx, :default_backend, EXLA.Backend
end
2 changes: 1 addition & 1 deletion lib/scholar/metrics/classification.ex
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ defmodule Scholar.Metrics.Classification do
brier_score_loss_schema = [
sample_weights: [
type: {:custom, Scholar.Options, :weights, []},
default: Nx.tensor(1.0),
default: 1.0,
doc: """
Sample weights of the observations.
"""
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ defmodule Scholar.MixProject do
{:ex_doc, "~> 0.30", only: :docs},
{:nx, "~> 0.6"},
{:nimble_options, "~> 0.5.2 or ~> 1.0"},
{:exla, "~> 0.6"},
{:exla, "~> 0.6", optional: true},
{:polaris, "~> 0.1"}
]
end
Expand Down

0 comments on commit a6e04b0

Please sign in to comment.