Skip to content

Commit b8499f3

Browse files
authored
Document new type parameter for AutoReverseDiff (#70)
1 parent d41670e commit b8499f3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/dense.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ function Base.show(io::IO, backend::AutoPolyesterForwardDiff{chunksize}) where {
219219
end
220220

221221
"""
222-
AutoReverseDiff
222+
AutoReverseDiff{compile}
223223
224224
Struct used to select the [ReverseDiff.jl](https://github.com/JuliaDiff/ReverseDiff.jl) backend for automatic differentiation.
225225
@@ -231,7 +231,7 @@ Defined by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
231231
232232
# Fields
233233
234-
- `compile::Union{Val, Bool}`: whether to [compile the tape](https://juliadiff.org/ReverseDiff.jl/api/#ReverseDiff.compile) prior to differentiation
234+
- `compile::Union{Val, Bool}`: whether to [compile the tape](https://juliadiff.org/ReverseDiff.jl/api/#ReverseDiff.compile) prior to differentiation (the boolean version is also the type parameter)
235235
"""
236236
struct AutoReverseDiff{C} <: AbstractADType
237237
compile::Bool # this field is left for legacy reasons

test/dense.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,21 +115,21 @@ end
115115
@testset "AutoReverseDiff" begin
116116
ad = @inferred AutoReverseDiff()
117117
@test ad isa AbstractADType
118-
@test ad isa AutoReverseDiff
118+
@test ad isa AutoReverseDiff{false}
119119
@test mode(ad) isa ReverseMode
120120
@test !ad.compile
121121
@test_deprecated ad.compile
122122

123123
ad = AutoReverseDiff(; compile = true)
124124
@test ad isa AbstractADType
125-
@test ad isa AutoReverseDiff
125+
@test ad isa AutoReverseDiff{true}
126126
@test mode(ad) isa ReverseMode
127127
@test ad.compile
128128
@test_deprecated ad.compile
129129

130130
ad = @inferred AutoReverseDiff(; compile = Val(true))
131131
@test ad isa AbstractADType
132-
@test ad isa AutoReverseDiff
132+
@test ad isa AutoReverseDiff{true}
133133
@test mode(ad) isa ReverseMode
134134
@test ad.compile
135135
@test_deprecated ad.compile

0 commit comments

Comments
 (0)