Skip to content

Commit

Permalink
chore: use ArrayInterface.aos_to_soa to handle mutable tracked contai…
Browse files Browse the repository at this point in the history
…ners
  • Loading branch information
DhairyaLGandhi committed Jun 24, 2024
1 parent 4ef4a9e commit 6adc3f1
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/concrete_solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1417,16 +1417,7 @@ function DiffEqBase._concrete_solve_adjoint(
end
else
# use TrackedArray for efficiency of the tape
_f(args...) = begin
res = prob.f(args...)
# reduce(vcat, vector_of_length_1) returns a Real
# this preserves the type of the returned vector
if length(res) == 1
res
else
reduce(vcat, res)
end
end
_f(args...) = ArrayInterface.aos_to_soa(prob.f(args...))
if prob isa SDEProblem
_g(args...) = reduce(vcat, prob.g(args...))
_prob = remake(prob,
Expand Down

0 comments on commit 6adc3f1

Please sign in to comment.