ForwardDiff.jl icon indicating copy to clipboard operation
ForwardDiff.jl copied to clipboard

dynamic NaN-safe mode switching

Open jrevels opened this issue 8 years ago • 3 comments

Follow-up issue to #179. From my comment there:

In a future PR, we could add AbstractConfig constructors like GradientConfig(x, Chunk{N}, NaNSafe{true}). The generated dual numbers would then contain partials of type Partials{N,T,true}, which would dispatch to the NaN-safe versions of methods. Downstream modules could then support passing that option through their APIs (or simply setting it to a reasonable default for themselves internally).

jrevels avatar Dec 26 '16 16:12 jrevels

This would be very nice to have!

cossio avatar Oct 15 '18 19:10 cossio

Is it possible we could use Preferences.jl to enable/disable NaN-safe mode now? See https://github.com/JuliaLang/Pkg.jl/issues/458. I think that would effectively solve this long-standing issue.

taylormcd avatar Mar 16 '21 17:03 taylormcd

NaN-safe mode switching via the Preferences.jl system was added in https://github.com/JuliaDiff/ForwardDiff.jl/pull/539.

devmotion avatar May 16 '22 09:05 devmotion