Skip to content

Commit 9b98c86

Browse files
committed
Document constructor instead of type
1 parent 99113c2 commit 9b98c86

File tree

1 file changed

+45
-99
lines changed

1 file changed

+45
-99
lines changed

src/dense.jl

Lines changed: 45 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
"""
2-
AutoChainRules{RC}
2+
AutoChainRules(; ruleconfig)
33
4-
Type used to select an automatic differentiation backend based on [ChainRulesCore.jl](https://github.com/JuliaDiff/ChainRulesCore.jl) (see the list [here](https://juliadiff.org/ChainRulesCore.jl/stable/index.html#ChainRules-roll-out-status)).
4+
Struct used to select an automatic differentiation backend based on [ChainRulesCore.jl](https://github.com/JuliaDiff/ChainRulesCore.jl) (see the list [here](https://juliadiff.org/ChainRulesCore.jl/stable/index.html#ChainRules-roll-out-status)).
55
6-
Exported by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
6+
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
77
8-
# Fields
8+
# Keyword Arguments
99
1010
- `ruleconfig::RC`: a [`ChainRulesCore.RuleConfig`](https://juliadiff.org/ChainRulesCore.jl/stable/rule_author/superpowers/ruleconfig.html) object.
11-
12-
# Constructor
13-
14-
AutoChainRules(; ruleconfig)
1511
"""
1612
Base.@kwdef struct AutoChainRules{RC} <: AbstractADType
1713
ruleconfig::RC
@@ -20,36 +16,28 @@ end
2016
mode(::AutoChainRules) = ForwardOrReverseMode() # specialized in the extension
2117

2218
"""
23-
AutoDiffractor
24-
25-
Type indicating the use of the [Diffractor.jl](https://github.com/JuliaDiff/Diffractor.jl) backend for automatic differentiation.
26-
27-
Exported by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
19+
AutoDiffractor()
2820
29-
# Constructor
21+
Struct used to select the [Diffractor.jl](https://github.com/JuliaDiff/Diffractor.jl) backend for automatic differentiation.
3022
31-
AutoDiffractor()
23+
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
3224
"""
3325
struct AutoDiffractor <: AbstractADType end
3426

3527
mode(::AutoDiffractor) = ForwardOrReverseMode()
3628

3729
"""
38-
AutoEnzyme{M}
30+
AutoEnzyme(; mode=nothing)
3931
40-
Type indicating the use of the [Enzyme.jl](https://github.com/EnzymeAD/Enzyme.jl) backend for automatic differentiation.
32+
Struct used to select the [Enzyme.jl](https://github.com/EnzymeAD/Enzyme.jl) backend for automatic differentiation.
4133
42-
Exported by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
34+
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
4335
44-
# Fields
36+
# Keyword Arguments
4537
4638
- `mode::M`: can be either
4739
- an object subtyping `EnzymeCore.Mode` (like `EnzymeCore.Forward` or `EnzymeCore.Reverse`) if a specific mode is required
4840
- `nothing` to choose the best mode automatically
49-
50-
# Constructors
51-
52-
AutoEnzyme(; mode=nothing)
5341
"""
5442
Base.@kwdef struct AutoEnzyme{M} <: AbstractADType
5543
mode::M = nothing
@@ -58,36 +46,28 @@ end
5846
mode(::AutoEnzyme) = ForwardOrReverseMode() # specialized in the extension
5947

6048
"""
61-
AutoFastDifferentiation
62-
63-
Type indicating the use of the [FastDifferentiation.jl](https://github.com/brianguenter/FastDifferentiation.jl) backend for automatic differentiation.
64-
65-
Exported by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
49+
AutoFastDifferentiation()
6650
67-
# Constructor
51+
Struct used to select the [FastDifferentiation.jl](https://github.com/brianguenter/FastDifferentiation.jl) backend for automatic differentiation.
6852
69-
AutoFastDifferentiation()
53+
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
7054
"""
7155
struct AutoFastDifferentiation <: AbstractADType end
7256

7357
mode(::AutoFastDifferentiation) = SymbolicMode()
7458

7559
"""
76-
AutoFiniteDiff{T1,T2,T3}
60+
AutoFiniteDiff(; fdtype=Val(:forward), fdjtype=fdtype, fdhtype=Val(:hcentral))
7761
78-
Type indicating the use of the [FiniteDiff.jl](https://github.com/JuliaDiff/FiniteDiff.jl) backend for automatic differentiation.
62+
Struct used to select the [FiniteDiff.jl](https://github.com/JuliaDiff/FiniteDiff.jl) backend for automatic differentiation.
7963
80-
Exported by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
64+
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
8165
82-
# Fields
66+
# Keyword Arguments
8367
8468
- `fdtype::T1`: finite difference type
8569
- `fdjtype::T2`: finite difference type for the Jacobian
8670
- `fdhtype::T3`: finite difference type for the Hessian
87-
88-
# Constructor
89-
90-
AutoFiniteDiff(; fdtype=Val(:forward), fdjtype=fdtype, fdhtype=Val(:hcentral))
9171
"""
9272
Base.@kwdef struct AutoFiniteDiff{T1, T2, T3} <: AbstractADType
9373
fdtype::T1 = Val(:forward)
@@ -98,19 +78,15 @@ end
9878
mode(::AutoFiniteDiff) = ForwardMode()
9979

10080
"""
101-
AutoFiniteDifferences{T}
81+
AutoFiniteDifferences(; fdm)
10282
103-
Type indicating the use of the [FiniteDifferences.jl](https://github.com/JuliaDiff/FiniteDifferences.jl) backend for automatic differentiation.
83+
Struct used to select the [FiniteDifferences.jl](https://github.com/JuliaDiff/FiniteDifferences.jl) backend for automatic differentiation.
10484
105-
Exported by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
85+
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
10686
107-
# Fields
87+
# Keyword Arguments
10888
10989
- `fdm::T`: a [`FiniteDifferenceMethod`](https://juliadiff.org/FiniteDifferences.jl/stable/pages/api/#FiniteDifferences.FiniteDifferenceMethod)
110-
111-
# Constructor
112-
113-
AutoFiniteDifferences(; fdm)
11490
"""
11591
Base.@kwdef struct AutoFiniteDifferences{T} <: AbstractADType
11692
fdm::T
@@ -119,23 +95,16 @@ end
11995
mode(::AutoFiniteDifferences) = ForwardMode()
12096

12197
"""
122-
AutoForwardDiff{chunksize,T}
98+
AutoForwardDiff(; chunksize=nothing, tag=nothing)
12399
124-
Type indicating the use of the [ForwardDiff.jl](https://github.com/JuliaDiff/ForwardDiff.jl) backend for automatic differentiation.
100+
Struct used to select the [ForwardDiff.jl](https://github.com/JuliaDiff/ForwardDiff.jl) backend for automatic differentiation.
125101
126-
Exported by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
102+
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
127103
128-
# Type parameters
104+
# Keyword Arguments
129105
130106
- `chunksize`: the preferred [chunk size](https://juliadiff.org/ForwardDiff.jl/stable/user/advanced/#Configuring-Chunk-Size) to evaluate several derivatives at once
131-
132-
# Fields
133-
134107
- `tag::T`: a [custom tag](https://juliadiff.org/ForwardDiff.jl/release-0.10/user/advanced.html#Custom-tags-and-tag-checking-1) to handle nested differentiation calls (usually not necessary)
135-
136-
# Constructors
137-
138-
AutoForwardDiff(; chunksize=nothing, tag=nothing)
139108
"""
140109
struct AutoForwardDiff{chunksize, T} <: AbstractADType
141110
tag::T
@@ -148,23 +117,16 @@ end
148117
mode(::AutoForwardDiff) = ForwardMode()
149118

150119
"""
151-
AutoPolyesterForwardDiff{chunksize,T}
120+
AutoPolyesterForwardDiff(; chunksize=nothing, tag=nothing)
152121
153-
Type indicating the use of the [PolyesterForwardDiff.jl](https://github.com/JuliaDiff/PolyesterForwardDiff.jl) backend for automatic differentiation.
122+
Struct used to select the [PolyesterForwardDiff.jl](https://github.com/JuliaDiff/PolyesterForwardDiff.jl) backend for automatic differentiation.
154123
155-
Exported by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
124+
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
156125
157-
# Type parameters
126+
# Keyword Arguments
158127
159128
- `chunksize`: the preferred [chunk size](https://juliadiff.org/ForwardDiff.jl/stable/user/advanced/#Configuring-Chunk-Size) to evaluate several derivatives at once
160-
161-
# Fields
162-
163129
- `tag::T`: a [custom tag](https://juliadiff.org/ForwardDiff.jl/release-0.10/user/advanced.html#Custom-tags-and-tag-checking-1) to handle nested differentiation calls (usually not necessary)
164-
165-
# Constructors
166-
167-
AutoPolyesterForwardDiff(; chunksize=nothing, tag=nothing)
168130
"""
169131
struct AutoPolyesterForwardDiff{chunksize, T} <: AbstractADType
170132
tag::T
@@ -177,19 +139,15 @@ end
177139
mode(::AutoPolyesterForwardDiff) = ForwardMode()
178140

179141
"""
180-
AutoReverseDiff
142+
AutoReverseDiff(; compile=false)
181143
182-
Type indicating the use of the [ReverseDiff.jl](https://github.com/JuliaDiff/ReverseDiff.jl) backend for automatic differentiation.
144+
Struct used to select the [ReverseDiff.jl](https://github.com/JuliaDiff/ReverseDiff.jl) backend for automatic differentiation.
183145
184-
Exported by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
146+
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
185147
186-
# Fields
148+
# Keyword Arguments
187149
188150
- `compile::Bool`: whether to [compile the tape](https://juliadiff.org/ReverseDiff.jl/api/#ReverseDiff.compile) prior to differentiation
189-
190-
# Constructor
191-
192-
AutoReverseDiff(; compile=false)
193151
"""
194152
Base.@kwdef struct AutoReverseDiff <: AbstractADType
195153
compile::Bool = false
@@ -198,30 +156,22 @@ end
198156
mode(::AutoReverseDiff) = ReverseMode()
199157

200158
"""
201-
AutoSymbolics
202-
203-
Type indicating the use of the [Symbolics.jl](https://github.com/JuliaSymbolics/Symbolics.jl) backend for automatic differentiation.
204-
205-
Exported by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
159+
AutoSymbolics()
206160
207-
# Constructor
161+
Struct used to select the [Symbolics.jl](https://github.com/JuliaSymbolics/Symbolics.jl) backend for automatic differentiation.
208162
209-
AutoSymbolics()
163+
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
210164
"""
211165
struct AutoSymbolics <: AbstractADType end
212166

213167
mode(::AutoSymbolics) = SymbolicMode()
214168

215169
"""
216-
AutoTapir
217-
218-
Type indicating the use of the [Tapir.jl](https://github.com/withbayes/Tapir.jl) backend for automatic differentiation.
170+
AutoTapir()
219171
220-
Exported by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
172+
Struct used to select the [Tapir.jl](https://github.com/withbayes/Tapir.jl) backend for automatic differentiation.
221173
222-
# Constructor
223-
224-
AutoTapir()
174+
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
225175
"""
226176
struct AutoTapir <: AbstractADType end
227177

@@ -230,9 +180,9 @@ mode(::AutoTapir) = ReverseMode()
230180
"""
231181
AutoTracker
232182
233-
Type indicating the use of the [Tracker.jl](https://github.com/FluxML/Tracker.jl) backend for automatic differentiation.
183+
Struct used to select the [Tracker.jl](https://github.com/FluxML/Tracker.jl) backend for automatic differentiation.
234184
235-
Exported by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
185+
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
236186
237187
# Constructor
238188
@@ -243,15 +193,11 @@ struct AutoTracker <: AbstractADType end
243193
mode(::AutoTracker) = ReverseMode()
244194

245195
"""
246-
AutoZygote
247-
248-
Type indicating the use of the [Zygote.jl](https://github.com/FluxML/Zygote.jl) backend for automatic differentiation.
249-
250-
Exported by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
196+
AutoZygote()
251197
252-
# Constructor
198+
Struct used to select the [Zygote.jl](https://github.com/FluxML/Zygote.jl) backend for automatic differentiation.
253199
254-
AutoZygote()
200+
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
255201
"""
256202
struct AutoZygote <: AbstractADType end
257203

0 commit comments

Comments
 (0)