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
149
149
the ` nansafe_mode ` preference to true, for example via:
150
150
151
151
``` julia
152
- julia> using ForwardDiff, Preferences
152
+ julia> using Preferences
153
153
154
154
julia> 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 )
166
155
167
156
julia> using ForwardDiff
168
157
169
158
julia> log (ForwardDiff. Dual {:tag} (0.0 , 0.0 ))
170
159
Dual {:tag} (- Inf ,0.0 )
171
160
```
172
161
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
+
173
166
In the future, we plan on allowing users and downstream library authors to dynamically
174
167
enable [ ` NaN ` -safe mode via the ` AbstractConfig `
175
168
API] ( https://github.com/JuliaDiff/ForwardDiff.jl/issues/181 ) .
You can’t perform that action at this time.
0 commit comments