@@ -143,7 +143,8 @@ reshape_jacobian(result::DiffResult, ydual, xdual) = reshape_jacobian(DiffResult
143
143
# vector mode #
144
144
# ##############
145
145
146
- function vector_mode_jacobian (f:: F , x, cfg:: JacobianConfig{T,V,N} ) where {F,T,V,N}
146
+ function vector_mode_jacobian (f:: F , x, cfg:: JacobianConfig{T} ) where {F,T}
147
+ N = chunksize (cfg)
147
148
ydual = vector_mode_dual_eval! (f, cfg, x)
148
149
ydual isa AbstractArray || throw (JACOBIAN_ERROR)
149
150
result = similar (ydual, valtype (eltype (ydual)), length (ydual), N)
@@ -152,7 +153,8 @@ function vector_mode_jacobian(f::F, x, cfg::JacobianConfig{T,V,N}) where {F,T,V,
152
153
return result
153
154
end
154
155
155
- function vector_mode_jacobian (f!:: F , y, x, cfg:: JacobianConfig{T,V,N} ) where {F,T,V,N}
156
+ function vector_mode_jacobian (f!:: F , y, x, cfg:: JacobianConfig{T} ) where {F,T}
157
+ N = chunksize (cfg)
156
158
ydual = vector_mode_dual_eval! (f!, cfg, y, x)
157
159
map! (d -> value (T,d), y, ydual)
158
160
result = similar (y, length (y), N)
@@ -161,14 +163,16 @@ function vector_mode_jacobian(f!::F, y, x, cfg::JacobianConfig{T,V,N}) where {F,
161
163
return result
162
164
end
163
165
164
- function vector_mode_jacobian! (result, f:: F , x, cfg:: JacobianConfig{T,V,N} ) where {F,T,V,N}
166
+ function vector_mode_jacobian! (result, f:: F , x, cfg:: JacobianConfig{T} ) where {F,T}
167
+ N = chunksize (cfg)
165
168
ydual = vector_mode_dual_eval! (f, cfg, x)
166
169
extract_jacobian! (T, result, ydual, N)
167
170
extract_value! (T, result, ydual)
168
171
return result
169
172
end
170
173
171
- function vector_mode_jacobian! (result, f!:: F , y, x, cfg:: JacobianConfig{T,V,N} ) where {F,T,V,N}
174
+ function vector_mode_jacobian! (result, f!:: F , y, x, cfg:: JacobianConfig{T} ) where {F,T}
175
+ N = chunksize (cfg)
172
176
ydual = vector_mode_dual_eval! (f!, cfg, y, x)
173
177
map! (d -> value (T,d), y, ydual)
174
178
extract_jacobian! (T, result, ydual, N)
0 commit comments