forked from elixir-nx/nx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmix.exs
More file actions
137 lines (126 loc) · 3.99 KB
/
Copy pathmix.exs
File metadata and controls
137 lines (126 loc) · 3.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
if :erlang.system_info(:otp_release) < ~c"24" do
Mix.raise("Nx requires Erlang/OTP 24+")
end
defmodule Nx.MixProject do
use Mix.Project
@source_url "https://github.com/elixir-nx/nx"
@version "0.5.3"
def project do
[
app: :nx,
version: @version,
elixir: "~> 1.14",
elixirc_paths: elixirc_paths(Mix.env()),
deps: deps(),
docs: docs(),
name: "Nx",
description: "Multi-dimensional arrays (tensors) and numerical definitions for Elixir",
package: package(),
preferred_cli_env: [
docs: :docs,
"hex.publish": :docs
]
]
end
def application do
[
extra_applications: [:logger],
mod: {Nx.Application, []},
env: [default_backend: {Nx.BinaryBackend, []}, default_defn_options: []]
]
end
defp elixirc_paths(:test), do: ~w(lib test/support)
defp elixirc_paths(_), do: ~w(lib)
defp deps do
[
{:complex, "~> 0.5"},
{:telemetry, "~> 0.4.0 or ~> 1.0"},
{:ex_doc, "~> 0.29.0", only: :docs}
]
end
defp package do
[
maintainers: ["Sean Moriarity", "José Valim", "Paulo Valente"],
licenses: ["Apache-2.0"],
links: %{"GitHub" => @source_url}
]
end
defp docs do
[
main: "Nx",
logo: "numbat.png",
source_url_pattern: "#{@source_url}/blob/v#{@version}/nx/%{path}#L%{line}",
before_closing_body_tag: &before_closing_body_tag/1,
extras: [
"guides/intro-to-nx.livemd",
"CHANGELOG.md"
],
skip_undefined_reference_warnings_on: ["CHANGELOG.md"],
groups_for_functions: [
Guards: &(&1[:type] in [:guards]),
"Functions: Aggregates": &(&1[:type] == :aggregation),
"Functions: Backend": &(&1[:type] == :backend),
"Functions: Conversion": &(&1[:type] == :conversion),
"Functions: Creation": &(&1[:type] in [:creation, :random]),
"Functions: Cumulative": &(&1[:type] == :cumulative),
"Functions: Element-wise": &(&1[:type] == :element),
"Functions: Indexed": &(&1[:type] == :indexed),
"Functions: N-dim": &(&1[:type] == :ndim),
"Functions: Shape": &(&1[:type] == :shape),
"Functions: Type": &(&1[:type] == :type),
"Functions: Window": &(&1[:type] == :window)
],
groups_for_modules: [
# Nx,
# Nx.Constants,
# Nx.Defn,
# Nx.Defn.Kernel,
# Nx.LinAlg,
# Nx.Serving,
Protocols: [
Nx.Container,
Nx.LazyContainer,
Nx.Stream
],
Structs: [
Nx.Batch,
Nx.Heatmap,
Nx.Tensor
],
Backends: [
Nx.Backend,
Nx.BinaryBackend,
Nx.TemplateBackend,
Nx.Type
],
Compilers: [
Nx.Defn.Compiler,
Nx.Defn.Composite,
Nx.Defn.Evaluator,
Nx.Defn.Expr,
Nx.Defn.Token,
Nx.Defn.Tree
]
]
]
end
defp before_closing_body_tag(:html) do
"""
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.13.19/dist/katex.min.css" integrity="sha384-beuqjL2bw+6DBM2eOpr5+Xlw+jiH44vMdVQwKxV28xxpoInPHTVmSvvvoPq9RdSh" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.19/dist/katex.min.js" integrity="sha384-aaNb715UK1HuP4rjZxyzph+dVss/5Nx3mLImBe9b0EW4vMUkc1Guw4VRyQKBC0eG" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.19/dist/contrib/auto-render.min.js" integrity="sha384-+XBljXPPiv+OzfbB3cVmLHf4hdUFHlWNZN5spNQ7rmHTXpd7WvJum6fIACpNNfIR" crossorigin="anonymous"
onload="renderMathInElement(document.body);"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
renderMathInElement(document.body, {
delimiters: [
{ left: "$$", right: "$$", display: true },
{ left: "$", right: "$", display: false },
]
});
});
</script>
"""
end
defp before_closing_body_tag(_), do: ""
end