@@ -43,15 +43,15 @@ function ForwardColorJacCache(f::F,x,_chunksize = nothing;
43
43
else
44
44
p = adapt .(parameterless_type (x),generate_chunked_partials (x,colorvec,chunksize))
45
45
_t = Dual {T,eltype(x),getsize(chunksize)} .(vec (x),ForwardDiff. Partials .(first (p)))
46
- t = ArrayInterface . restructure (x,_t)
46
+ t = ArrayInterfaceCore . restructure (x,_t)
47
47
end
48
48
49
49
50
50
if dx isa Nothing
51
51
fx = similar (t)
52
52
_dx = similar (x)
53
53
else
54
- tup = ArrayInterface . allowed_getindex (ArrayInterface . allowed_getindex (p,1 ),1 ) .* false
54
+ tup = ArrayInterfaceCore . allowed_getindex (ArrayInterfaceCore . allowed_getindex (p,1 ),1 ) .* false
55
55
_pi = adapt (parameterless_type (dx),[tup for i in 1 : length (dx)])
56
56
fx = reshape (Dual {T,eltype(dx),length(tup)} .(vec (dx),ForwardDiff. Partials .(_pi)),size (dx)... )
57
57
_dx = dx
134
134
135
135
function forwarddiff_color_jacobian (f:: F ,x:: AbstractArray{<:Number} ,jac_cache:: ForwardColorJacCache ,jac_prototype= nothing ) where F
136
136
137
- if jac_prototype isa Nothing ? ArrayInterface . ismutable (x) : ArrayInterface . ismutable (jac_prototype)
137
+ if jac_prototype isa Nothing ? ArrayInterfaceCore . ismutable (x) : ArrayInterfaceCore . ismutable (jac_prototype)
138
138
# Whenever J is mutable, we mutate it to avoid allocations
139
139
dx = jac_cache. dx
140
140
vecx = vec (x)
@@ -164,7 +164,7 @@ function forwarddiff_color_jacobian(J::AbstractMatrix{<:Number},f::F,x::Abstract
164
164
nrows,ncols = size (J)
165
165
166
166
if ! (sparsity isa Nothing)
167
- rows_index, cols_index = ArrayInterface . findstructralnz (sparsity)
167
+ rows_index, cols_index = ArrayInterfaceCore . findstructralnz (sparsity)
168
168
rows_index = [rows_index[i] for i in 1 : length (rows_index)]
169
169
cols_index = [cols_index[i] for i in 1 : length (cols_index)]
170
170
end
@@ -232,7 +232,7 @@ function forwarddiff_color_jacobian_immutable(f,x::AbstractArray{<:Number},jac_c
232
232
nrows,ncols = size (J)
233
233
234
234
if ! (sparsity isa Nothing)
235
- rows_index, cols_index = ArrayInterface . findstructralnz (sparsity)
235
+ rows_index, cols_index = ArrayInterfaceCore . findstructralnz (sparsity)
236
236
rows_index = [rows_index[i] for i in 1 : length (rows_index)]
237
237
cols_index = [cols_index[i] for i in 1 : length (cols_index)]
238
238
end
@@ -277,7 +277,7 @@ function forwarddiff_color_jacobian!(J::AbstractMatrix{<:Number},
277
277
x:: AbstractArray{<:Number} ;
278
278
dx = similar (x,size (J,1 )),
279
279
colorvec = 1 : length (x),
280
- sparsity = ArrayInterface . has_sparsestruct (J) ? J : nothing )
280
+ sparsity = ArrayInterfaceCore . has_sparsestruct (J) ? J : nothing )
281
281
forwarddiff_color_jacobian! (J,f,x,ForwardColorJacCache (f,x,dx= dx,colorvec= colorvec,sparsity= sparsity))
282
282
end
283
283
@@ -305,7 +305,7 @@ function forwarddiff_color_jacobian!(J::AbstractMatrix{<:Number},
305
305
end
306
306
307
307
if FiniteDiff. _use_findstructralnz (sparsity)
308
- rows_index, cols_index = ArrayInterface . findstructralnz (sparsity)
308
+ rows_index, cols_index = ArrayInterfaceCore . findstructralnz (sparsity)
309
309
else
310
310
rows_index = 1 : size (J,1 )
311
311
cols_index = 1 : size (J,2 )
@@ -344,7 +344,7 @@ function forwarddiff_color_jacobian!(J::AbstractMatrix{<:Number},
344
344
dx .= partials .(fx, j)
345
345
end
346
346
347
- if ArrayInterface . fast_scalar_indexing (dx)
347
+ if ArrayInterfaceCore . fast_scalar_indexing (dx)
348
348
# dx is implicitly used in vecdx
349
349
if sparseCSC_common_sparsity
350
350
FiniteDiff. _colorediteration! (J,vecdx,colorvec,color_i,ncols)
0 commit comments