-
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #956 from SciML/ad_piracy
Remove AD piracy functions by moving to SciMLBase
- Loading branch information
Showing
8 changed files
with
53 additions
and
352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module DiffEqBaseChainRulesCoreExt | ||
|
||
using DiffEqBase | ||
import DiffEqBase: numargs | ||
|
||
import ChainRulesCore | ||
import ChainRulesCore: NoTangent | ||
|
||
ChainRulesCore.rrule(::typeof(numargs), f) = (numargs(f), df -> (NoTangent(), NoTangent())) | ||
ChainRulesCore.@non_differentiable checkkwargs(kwargshandle) | ||
|
||
function ChainRulesCore.frule(::typeof(solve_up), prob, | ||
sensealg::Union{Nothing, AbstractSensitivityAlgorithm}, | ||
u0, p, args...; | ||
kwargs...) | ||
_solve_forward(prob, sensealg, u0, p, SciMLBase.ChainRulesOriginator(), args...; | ||
kwargs...) | ||
end | ||
|
||
function ChainRulesCore.rrule(::typeof(solve_up), prob::AbstractDEProblem, | ||
sensealg::Union{Nothing, AbstractSensitivityAlgorithm}, | ||
u0, p, args...; | ||
kwargs...) | ||
_solve_adjoint(prob, sensealg, u0, p, SciMLBase.ChainRulesOriginator(), args...; | ||
kwargs...) | ||
end | ||
|
||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.