-
-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Description
I am facing BoundsErrors when calling get_tmp and can't quite figure out what's going wrong.
My package versions on Julia 1.6.2:
[d236fae5] PreallocationTools v0.2.0
[f6369f11] ForwardDiff v0.10.23
An MWE that produces this error:
using PreallocationTools
import ForwardDiff
using LinearAlgebra
function rhs!(du, u, p, t)
A = p
du = get_tmp(du, A)
mul!(du, A, u)
end
u = [1.0, 0.0]
A = [0.0 1.0;
1.0 0.0]
du = similar(u)
_du = dualcache(du)
# this one works
rhs!(_du, u, A, 0.0)
# throws BoundsError
ForwardDiff.gradient(A -> rhs!(_du, u, A, 0.0), A)
Am I doing something wrong here?
Metadata
Metadata
Assignees
Labels
No labels