Skip to content

Commit

Permalink
Reactant: add extension to prevent stackoverflow (FluxML#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses authored Jan 5, 2025
1 parent 34250b2 commit 12b7f31
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
[weakdeps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869"
Reactant = "3c362404-f566-11ee-1572-e11a4b42c853"

[extensions]
OptimisersAdaptExt = ["Adapt"]
OptimisersEnzymeCoreExt = "EnzymeCore"
OptimisersReactantExt = "Reactant"

[compat]
Adapt = "4"
Expand Down
8 changes: 8 additions & 0 deletions ext/OptimisersReactantExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module OptimisersReactantExt

import Optimisers
import Reactant

Optimisers._eps(T::Type{<:Reactant.TracedRNumber{<:AbstractFloat}}, e) = T(e)

end

0 comments on commit 12b7f31

Please sign in to comment.