File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -149,27 +149,20 @@ ForwardDiff's `NaN`-safe mode by using the
149149the ` nansafe_mode ` preference to true, for example via:
150150
151151``` julia
152- julia> using ForwardDiff, Preferences
152+ julia> using Preferences
153153
154154julia> set_preferences! (ForwardDiff, " nansafe_mode" => true )
155- ```
156-
157- Note that Julia has to be restarted and ForwardDiff has to be reloaded after changing
158- this preference.
159-
160- Alternatively, you can set the preference before loading ForwardDiff, for example via:
161-
162- ``` julia
163- julia> using Preferences, UUIDs
164-
165- julia> set_preferences! (UUID (" f6369f11-7733-5829-9624-2563aa707210" ), " nansafe_mode" => true )
166155
167156julia> using ForwardDiff
168157
169158julia> log (ForwardDiff. Dual {:tag} (0.0 , 0.0 ))
170159Dual {:tag} (- Inf ,0.0 )
171160```
172161
162+ !!! warn
163+ The preference has to be set ** before** loading ForwardDiff.
164+ If you change it after loading ForwardDiff, you have to restart your Julia session and reload ForwardDiff for it to become active.
165+
173166In the future, we plan on allowing users and downstream library authors to dynamically
174167enable [ ` NaN ` -safe mode via the ` AbstractConfig `
175168API] ( https://github.com/JuliaDiff/ForwardDiff.jl/issues/181 ) .
You can’t perform that action at this time.
0 commit comments