Skip to content

Commit cf2edd8

Browse files
committed
make sure that Partials length is known
1 parent 5b51b11 commit cf2edd8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/LinearSolveForwardDiffExt.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const DualBLinearProblem = LinearProblem{
3434
const DualAbstractLinearProblem = Union{
3535
DualLinearProblem, DualALinearProblem, DualBLinearProblem}
3636

37-
LinearSolve.@concrete mutable struct DualLinearCache{DT <: Dual}
37+
LinearSolve.@concrete mutable struct DualLinearCache{DT}
3838
linear_cache
3939

4040
partials_A
@@ -113,10 +113,10 @@ function linearsolve_dual_solution(
113113
end
114114

115115
function linearsolve_dual_solution(u::AbstractArray, partials,
116-
cache::DualLinearCache{DT}) where {DT}
116+
cache::DualLinearCache{DT}) where {T, V, N, DT <: Dual{T,V,N}}
117117
# Handle single-level duals for arrays
118118
partials_list = RecursiveArrayTools.VectorOfArray(partials)
119-
return map(((uᵢ, pᵢ),) -> DT(uᵢ, Partials(Tuple(pᵢ))),
119+
return map(((uᵢ, pᵢ),) -> DT(uᵢ, Partials{N,V}(NTuple{N,V}(pᵢ))),
120120
zip(u, partials_list[i, :] for i in 1:length(partials_list.u[1])))
121121
end
122122

0 commit comments

Comments
 (0)