-
-
Notifications
You must be signed in to change notification settings - Fork 157
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
ERROR: LoadError: TypeError: in typeassert, expected Float64, got a value of type ForwardDiff.Dual{Nothing, Float64, 2} #636
Comments
We should just get rid of the mutation in that function: function jacobian_fn(f, x::AbstractMatrix)
y, back = Zygote.pullback(f, x)
z = Zygote.@ignore similar(y)
Zygote.@ignore fill!(z, zero(eltype(x)))
out = map(1:size(y, 1)) do i
Zygote.@ignore z[i, :] .+= one(eltype(x))
xx = back(z)[1]
end
@show size(Array(VectorOfArray(out)))
return Array(VectorOfArray(out))
end But |
I think the problem comes from sensealg = InterpolatingAdjoint(autojacvec=false) because sensealg = InterpolatingAdjoint() works fine. |
Oh interesting. I think it might need to |
Yup, I'll have a look later today. |
From a quick look in the lines around https://github.com/SciML/DiffEqSensitivity.jl/blob/22b52f82cd8177046ef32adb3baf402983249d61/src/derivative_wrappers.jl#L267 Indeed
Wrapping a
Is that the solution you meant, @ChrisRackauckas? And is: Line 169 in 73817a5
the definition of the ODE function that needs to be differentiated? (Haven't looked at the ffjord implementation so far) |
Yeah that's what I meant. Odd. |
When I run this code:
I get this error:
In this environment:
The text was updated successfully, but these errors were encountered: