Skip to content

Commit 907508a

Browse files
authored
Fix imports in ReverseDiff extension
1 parent ffa664f commit 907508a

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

ext/DiffEqBaseForwardDiffExt.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ using DiffEqBase: Void, FunctionWrappersWrappers, OrdinaryDiffEqTag, AbstractTim
66
RecursiveArrayTools, reduce_tup, _promote_tspan, has_continuous_callback
77
import DiffEqBase: hasdualpromote, wrapfun_oop, wrapfun_iip, prob2dtmin,
88
promote_tspan, anyeltypedual, isdualtype, value, ODE_DEFAULT_NORM,
9-
InternalITP, nextfloat_tdir, DualEltypeChecker, sse, totallength
9+
InternalITP, nextfloat_tdir, DualEltypeChecker, sse
1010

1111
eltypedual(x) = eltype(x) <: ForwardDiff.Dual
1212
isdualtype(::Type{<:ForwardDiff.Dual}) = true
@@ -501,19 +501,19 @@ unitfulvalue(x::Type{ForwardDiff.Dual{T, V, N}}) where {T, V, N} = V
501501
unitfulvalue(x::ForwardDiff.Dual) = unitfulvalue(ForwardDiff.unitfulvalue(x))
502502

503503
sse(x::ForwardDiff.Dual) = sse(ForwardDiff.value(x)) + sum(sse, ForwardDiff.partials(x))
504-
function totallength(x::ForwardDiff.Dual)
505-
totallength(ForwardDiff.value(x)) + sum(totallength, ForwardDiff.partials(x))
504+
function DiffEqBase.totallength(x::ForwardDiff.Dual)
505+
return DiffEqBase.totallength(ForwardDiff.value(x)) + sum(DiffEqBase.totallength, ForwardDiff.partials(x))
506506
end
507507

508508
@inline ODE_DEFAULT_NORM(u::ForwardDiff.Dual, ::Any) = sqrt(sse(u))
509509
@inline function ODE_DEFAULT_NORM(u::AbstractArray{<:ForwardDiff.Dual{Tag, T}},
510510
t::Any) where {Tag, T}
511-
sqrt(DiffEqBase.__sum(sse, u; init = sse(zero(T))) / totallength(u))
511+
sqrt(DiffEqBase.__sum(sse, u; init = sse(zero(T))) / DiffEqBase.totallength(u))
512512
end
513513
@inline ODE_DEFAULT_NORM(u::ForwardDiff.Dual, ::ForwardDiff.Dual) = sqrt(sse(u))
514514
@inline function ODE_DEFAULT_NORM(u::AbstractArray{<:ForwardDiff.Dual{Tag, T}},
515515
::ForwardDiff.Dual) where {Tag, T}
516-
sqrt(DiffEqBase.__sum(sse, u; init = sse(zero(T))) / totallength(u))
516+
sqrt(DiffEqBase.__sum(sse, u; init = sse(zero(T))) / DiffEqBase.totallength(u))
517517
end
518518

519519
if !hasmethod(nextfloat, Tuple{ForwardDiff.Dual})

ext/DiffEqBaseReverseDiffExt.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ using DiffEqBase
44
import DiffEqBase: value
55
import ReverseDiff
66
import DiffEqBase.ArrayInterface
7-
import DiffEqBase.ForwardDiff
87

98
function DiffEqBase.anyeltypedual(::Type{T},
109
::Type{Val{counter}} = Val{0}) where {counter} where {

0 commit comments

Comments
 (0)