We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a2b2000 commit aeae29bCopy full SHA for aeae29b
src/apiutils.jl
@@ -18,14 +18,14 @@ end
18
# vector mode function evaluation #
19
###################################
20
21
-@generated function dualize(::Type{T}, x::StaticArray) where T
22
- N = _static_length(StaticArraysCore.Size(x))
+@generated function dualize(::Type{T}, x::S) where {T, S<:StaticArray}
+ N = _static_length(StaticArraysCore.Size(S))
23
dx = Expr(:tuple, [:(Dual{T}(x[$i], chunk, Val{$i}())) for i in 1:N]...)
24
- V = StaticArraysCore.similar_type(x, Dual{T,eltype(x),N})
25
return quote
+ V = StaticArraysCore.similar_type(S, Dual{$T, $(eltype(x)), $N})
26
chunk = Chunk{$N}()
27
$(Expr(:meta, :inline))
28
- return $V($(dx))
+ return V($(dx))
29
end
30
31
0 commit comments