You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/dense.jl
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,7 @@ end
72
72
```
73
73
74
74
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).
76
76
77
77
```julia
78
78
parameter = [0.0]
@@ -82,7 +82,7 @@ end
82
82
```
83
83
84
84
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).
86
86
87
87
```julia
88
88
cache = [0.0]
@@ -94,7 +94,7 @@ end
94
94
95
95
The function `f3` is a closure over `cache`, and `cache` is modified based on the input `x`.
96
96
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).
0 commit comments