-
-
Notifications
You must be signed in to change notification settings - Fork 120
fix: fix usage of ReverseDiff in parameters #1078
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
b24a59e
036c669
b818689
eb42bc2
4e60a87
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -352,6 +352,12 @@ DiffEqBase.anyeltypedual(f::SciMLBase.AbstractSciMLFunction, ::Type{Val{counter} | |
@inline promote_u0(::Nothing, p, t0) = nothing | ||
|
||
@inline function promote_u0(u0, p, t0) | ||
if SciMLStructures.isscimlstructure(p) | ||
_p = SciMLStructures.canonicalize(SciMLStructures.Tunable(), p)[1] | ||
if _p != p | ||
return promote_u0(u0, _p, t0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. won't you need to restructure or replace! with this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, we're not changing |
||
end | ||
end | ||
Tu = eltype(u0) | ||
if Tu <: ForwardDiff.Dual | ||
return u0 | ||
|
@@ -373,6 +379,12 @@ DiffEqBase.anyeltypedual(f::SciMLBase.AbstractSciMLFunction, ::Type{Val{counter} | |
end | ||
|
||
@inline function promote_u0(u0::AbstractArray{<:Complex}, p, t0) | ||
if SciMLStructures.isscimlstructure(p) | ||
_p = SciMLStructures.canonicalize(SciMLStructures.Tunable(), p)[1] | ||
if _p != p | ||
return promote_u0(u0, _p, t0) | ||
end | ||
end | ||
Tu = real(eltype(u0)) | ||
if Tu <: ForwardDiff.Dual | ||
return u0 | ||
|
Uh oh!
There was an error while loading. Please reload this page.