Skip to content

Commit 9ea5887

Browse files
Merge pull request #57 from SciML/gd/fields
Restore full API in docstrings
2 parents 3d4e912 + 0921565 commit 9ea5887

File tree

2 files changed

+90
-36
lines changed

2 files changed

+90
-36
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ uuid = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
33
authors = [
44
"Vaibhav Dixit <[email protected]>, Guillaume Dalle and contributors",
55
]
6-
version = "1.2.0"
6+
version = "1.2.1"
77

88
[deps]
99
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"

src/dense.jl

Lines changed: 89 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
"""
2-
AutoChainRules(; ruleconfig)
2+
AutoChainRules{RC}
33
44
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 from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
6+
Defined by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
7+
8+
# Constructors
9+
10+
AutoChainRules(; ruleconfig)
711
8-
# Keyword Arguments
12+
# Fields
913
1014
- `ruleconfig::RC`: a [`ChainRulesCore.RuleConfig`](https://juliadiff.org/ChainRulesCore.jl/stable/rule_author/superpowers/ruleconfig.html) object.
1115
"""
@@ -16,24 +20,32 @@ end
1620
mode(::AutoChainRules) = ForwardOrReverseMode() # specialized in the extension
1721

1822
"""
19-
AutoDiffractor()
23+
AutoDiffractor
2024
2125
Struct used to select the [Diffractor.jl](https://github.com/JuliaDiff/Diffractor.jl) backend for automatic differentiation.
2226
23-
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
27+
Defined by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
28+
29+
# Constructors
30+
31+
AutoDiffractor()
2432
"""
2533
struct AutoDiffractor <: AbstractADType end
2634

2735
mode(::AutoDiffractor) = ForwardOrReverseMode()
2836

2937
"""
30-
AutoEnzyme(; mode=nothing)
38+
AutoEnzyme{M}
3139
3240
Struct used to select the [Enzyme.jl](https://github.com/EnzymeAD/Enzyme.jl) backend for automatic differentiation.
41+
42+
Defined by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
43+
44+
# Constructors
3345
34-
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
46+
AutoEnzyme(; mode=nothing)
3547
36-
# Keyword Arguments
48+
# Fields
3749
3850
- `mode::M`: can be either
3951
- an object subtyping `EnzymeCore.Mode` (like `EnzymeCore.Forward` or `EnzymeCore.Reverse`) if a specific mode is required
@@ -46,24 +58,32 @@ end
4658
mode(::AutoEnzyme) = ForwardOrReverseMode() # specialized in the extension
4759

4860
"""
49-
AutoFastDifferentiation()
61+
AutoFastDifferentiation
5062
5163
Struct used to select the [FastDifferentiation.jl](https://github.com/brianguenter/FastDifferentiation.jl) backend for automatic differentiation.
5264
53-
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
65+
Defined by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
66+
67+
# Constructors
68+
69+
AutoFastDifferentiation()
5470
"""
5571
struct AutoFastDifferentiation <: AbstractADType end
5672

5773
mode(::AutoFastDifferentiation) = SymbolicMode()
5874

5975
"""
60-
AutoFiniteDiff(; fdtype=Val(:forward), fdjtype=fdtype, fdhtype=Val(:hcentral))
76+
AutoFiniteDiff{T1,T2,T3}
6177
6278
Struct used to select the [FiniteDiff.jl](https://github.com/JuliaDiff/FiniteDiff.jl) backend for automatic differentiation.
6379
64-
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
80+
Defined by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
81+
82+
# Constructors
83+
84+
AutoFiniteDiff(; fdtype=Val(:forward), fdjtype=fdtype, fdhtype=Val(:hcentral))
6585
66-
# Keyword Arguments
86+
# Fields
6787
6888
- `fdtype::T1`: finite difference type
6989
- `fdjtype::T2`: finite difference type for the Jacobian
@@ -78,13 +98,17 @@ end
7898
mode(::AutoFiniteDiff) = ForwardMode()
7999

80100
"""
81-
AutoFiniteDifferences(; fdm)
101+
AutoFiniteDifferences{T}
82102
83103
Struct used to select the [FiniteDifferences.jl](https://github.com/JuliaDiff/FiniteDifferences.jl) backend for automatic differentiation.
84104
85-
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
105+
Defined by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
106+
107+
# Constructors
86108
87-
# Keyword Arguments
109+
AutoFiniteDifferences(; fdm)
110+
111+
# Fields
88112
89113
- `fdm::T`: a [`FiniteDifferenceMethod`](https://juliadiff.org/FiniteDifferences.jl/stable/pages/api/#FiniteDifferences.FiniteDifferenceMethod)
90114
"""
@@ -95,15 +119,22 @@ end
95119
mode(::AutoFiniteDifferences) = ForwardMode()
96120

97121
"""
98-
AutoForwardDiff(; chunksize=nothing, tag=nothing)
122+
AutoForwardDiff{chunksize,T}
99123
100124
Struct used to select the [ForwardDiff.jl](https://github.com/JuliaDiff/ForwardDiff.jl) backend for automatic differentiation.
101125
102-
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
126+
Defined by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
103127
104-
# Keyword Arguments
128+
# Constructors
129+
130+
AutoForwardDiff(; chunksize=nothing, tag=nothing)
131+
132+
# Type parameters
105133
106134
- `chunksize`: the preferred [chunk size](https://juliadiff.org/ForwardDiff.jl/stable/user/advanced/#Configuring-Chunk-Size) to evaluate several derivatives at once
135+
136+
# Fields
137+
107138
- `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)
108139
"""
109140
struct AutoForwardDiff{chunksize, T} <: AbstractADType
@@ -117,15 +148,22 @@ end
117148
mode(::AutoForwardDiff) = ForwardMode()
118149

119150
"""
151+
AutoPolyesterForwardDiff{chunksize,T}
152+
153+
Struct used to select the [PolyesterForwardDiff.jl](https://github.com/JuliaDiff/PolyesterForwardDiff.jl) backend for automatic differentiation.
154+
155+
Defined by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
156+
157+
# Constructors
158+
120159
AutoPolyesterForwardDiff(; chunksize=nothing, tag=nothing)
121160
122-
Struct used to select the [PolyesterForwardDiff.jl](https://github.com/JuliaDiff/PolyesterForwardDiff.jl) backend for automatic differentiation.
161+
# Type parameters
123162
124-
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
163+
- `chunksize`: the preferred [chunk size](https://juliadiff.org/ForwardDiff.jl/stable/user/advanced/#Configuring-Chunk-Size) to evaluate several derivatives at once
125164
126-
# Keyword Arguments
165+
# Fields
127166
128-
- `chunksize`: the preferred [chunk size](https://juliadiff.org/ForwardDiff.jl/stable/user/advanced/#Configuring-Chunk-Size) to evaluate several derivatives at once
129167
- `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)
130168
"""
131169
struct AutoPolyesterForwardDiff{chunksize, T} <: AbstractADType
@@ -139,13 +177,17 @@ end
139177
mode(::AutoPolyesterForwardDiff) = ForwardMode()
140178

141179
"""
142-
AutoReverseDiff(; compile=false)
180+
AutoReverseDiff
143181
144182
Struct used to select the [ReverseDiff.jl](https://github.com/JuliaDiff/ReverseDiff.jl) backend for automatic differentiation.
145183
146-
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
184+
Defined by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
185+
186+
# Constructors
147187
148-
# Keyword Arguments
188+
AutoReverseDiff(; compile=false)
189+
190+
# Fields
149191
150192
- `compile::Bool`: whether to [compile the tape](https://juliadiff.org/ReverseDiff.jl/api/#ReverseDiff.compile) prior to differentiation
151193
"""
@@ -156,24 +198,32 @@ end
156198
mode(::AutoReverseDiff) = ReverseMode()
157199

158200
"""
159-
AutoSymbolics()
201+
AutoSymbolics
160202
161203
Struct used to select the [Symbolics.jl](https://github.com/JuliaSymbolics/Symbolics.jl) backend for automatic differentiation.
162204
163-
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
205+
Defined by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
206+
207+
# Constructors
208+
209+
AutoSymbolics()
164210
"""
165211
struct AutoSymbolics <: AbstractADType end
166212

167213
mode(::AutoSymbolics) = SymbolicMode()
168214

169215
"""
170-
AutoTapir()
216+
AutoTapir
171217
172218
Struct used to select the [Tapir.jl](https://github.com/withbayes/Tapir.jl) backend for automatic differentiation.
173219
174-
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
220+
Defined by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
221+
222+
# Constructors
175223
176-
# Keyword Arguments
224+
AutoTapir(; safe_mode=true)
225+
226+
# Fields
177227
178228
- `safe_mode::Bool`: whether to run additional checks to catch errors early. On by default. Turn off to maximise performance if your code runs correctly.
179229
"""
@@ -188,9 +238,9 @@ mode(::AutoTapir) = ReverseMode()
188238
189239
Struct used to select the [Tracker.jl](https://github.com/FluxML/Tracker.jl) backend for automatic differentiation.
190240
191-
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
241+
Defined by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
192242
193-
# Constructor
243+
# Constructors
194244
195245
AutoTracker()
196246
"""
@@ -199,11 +249,15 @@ struct AutoTracker <: AbstractADType end
199249
mode(::AutoTracker) = ReverseMode()
200250

201251
"""
202-
AutoZygote()
252+
AutoZygote
203253
204254
Struct used to select the [Zygote.jl](https://github.com/FluxML/Zygote.jl) backend for automatic differentiation.
205255
206-
Exported from [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
256+
Defined by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
257+
258+
# Constructors
259+
260+
AutoZygote()
207261
"""
208262
struct AutoZygote <: AbstractADType end
209263

0 commit comments

Comments
 (0)