SciML / ADTypes.jl

Repository for automatic differentiation backend types
https://sciml.github.io/ADTypes.jl/
MIT License
37 stars 11 forks source link

Add AD type for FiniteDifferences #11

Closed devmotion closed 1 year ago

devmotion commented 1 year ago

Maybe it would be reasonable to add a type for FiniteDifferences as well?

A bit inconsistent, in contrast to #10 in this PR I opted for a default value of nothing since I wanted to avoid pulling in FiniteDifferences which has much more dependencies than EnzymeCore. Alternatively, on Julia >= 1.9 one could add a weak dependency on FiniteDifferences and define a constructor with a more concrete default value such as FiniteDifferences.central_fdm(5, 1) (but this would lead to inconsistencies between Julia < 1.9 and >= 1.9...).

Vaibhavdixit02 commented 1 year ago

We should avoid that as you noted, for the extension we can do it separately but I think it might even be sufficient as it is now and the package using it can work around it