@@ -76,7 +76,8 @@ be a Dual number. This causes the error. To fix it:
76
76
1 . Specify the ` autodiff ` to be ` AutoFiniteDiff `
77
77
78
78
``` @example dual_error_faq
79
- sol = solve(prob_oop, LevenbergMarquardt(; autodiff = AutoFiniteDiff());
79
+ import ADTypes
80
+ sol = solve(prob_oop, LevenbergMarquardt(; autodiff = ADTypes.AutoFiniteDiff());
80
81
maxiters = 10000, abstol = 1e-8)
81
82
```
82
83
@@ -110,6 +111,7 @@ internally. See this simple example:
110
111
```@example type_unstable
111
112
import NonlinearSolve as NLS
112
113
import InteractiveUtils
114
+ import ADTypes
113
115
114
116
f(u, p) = @. u^2 - p
115
117
@@ -134,7 +136,7 @@ nothing # hide
134
136
Again Type-Stable! Now let's try using a regular array:
135
137
136
138
``` @example type_unstable
137
- prob = NonlinearProblem(f, [1.0, 2.0], 2.0)
139
+ prob = NLS. NonlinearProblem(f, [1.0, 2.0], 2.0)
138
140
139
141
InteractiveUtils.@code_warntype NLS.solve(prob, NLS.NewtonRaphson())
140
142
nothing # hide
@@ -145,10 +147,10 @@ it will be dynamic and lead to dynamic dispatch. To fix this, we directly specif
145
147
chunksize:
146
148
147
149
``` @example type_unstable
148
- InteractiveUtils.@code_warntype solve(
150
+ InteractiveUtils.@code_warntype NLS. solve(
149
151
prob,
150
- NewtonRaphson(;
151
- autodiff = AutoForwardDiff(; chunksize = NonlinearSolve.pickchunksize(prob.u0))
152
+ NLS. NewtonRaphson(;
153
+ autodiff = ADTypes. AutoForwardDiff(; chunksize = NonlinearSolve.pickchunksize(prob.u0))
152
154
)
153
155
)
154
156
nothing # hide
0 commit comments