From 4f68b0ad76fab963188e975c8577f185b37db0b1 Mon Sep 17 00:00:00 2001 From: Yingbo Ma Date: Tue, 15 Oct 2024 23:37:32 -0400 Subject: [PATCH] Intercept frule at the top level --- ext/DataInterpolationsChainRulesCoreExt.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/DataInterpolationsChainRulesCoreExt.jl b/ext/DataInterpolationsChainRulesCoreExt.jl index c7c4da8f..c59a7f11 100644 --- a/ext/DataInterpolationsChainRulesCoreExt.jl +++ b/ext/DataInterpolationsChainRulesCoreExt.jl @@ -121,4 +121,8 @@ function ChainRulesCore.frule((_, _, Δt), ::typeof(_interpolate), A::AbstractIn return _interpolate(A, t), derivative(A, t) * Δt end +function ChainRulesCore.frule((_, Δt), A::AbstractInterpolation, t::Number) + return A(t), derivative(A, t) * Δt +end + end # module