Skip to content

Commit 6e3a00e

Browse files
committed
Details
1 parent ae81822 commit 6e3a00e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/dense.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ end
7272
```
7373
7474
The function `f1` is not a closure, it does not contain any data.
75-
Thus `f1` can be differentiated with `AutoEnzyme(constant_function=true)`.
75+
Thus `f1` can be differentiated with `AutoEnzyme(constant_function=true)` (although here setting `constant_function=false` would change neither correctness nor performance).
7676
7777
```julia
7878
parameter = [0.0]
@@ -82,7 +82,7 @@ end
8282
```
8383
8484
The function `f2` is a closure over `parameter`, but `parameter` is never modified based on the input `x`.
85-
Thus, `f2` can be differentiated with `AutoEnzyme(constant_function=true)`.
85+
Thus, `f2` can be differentiated with `AutoEnzyme(constant_function=true)` (setting `constant_function=false` would not change correctness but would hinder performance).
8686
8787
```julia
8888
cache = [0.0]
@@ -94,7 +94,7 @@ end
9494
9595
The function `f3` is a closure over `cache`, and `cache` is modified based on the input `x`.
9696
That means `cache` cannot be treated as constant, since derivative values must be propagated through it.
97-
Thus `f3` must be differentiated with `AutoEnzyme(constant_function=false)`.
97+
Thus `f3` must be differentiated with `AutoEnzyme(constant_function=false)` (setting `constant_function=true` would make the result incorrect).
9898
"""
9999
struct AutoEnzyme{M, constant_function} <: AbstractADType
100100
mode::M

0 commit comments

Comments
 (0)