Skip to content

Commit 7336f2d

Browse files
fix: fix depwarn in responsible_map
1 parent 8763f7b commit 7336f2d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/ensemble/basic_ensemble_solve.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,16 @@ function solve_batch(prob, alg, ensemblealg::EnsembleDistributed, II, pmap_batch
233233
tighten_container_eltype(batch_data)
234234
end
235235

236+
__getindex(x, i) = x[i]
237+
__getindex(x::AbstractVectorOfArray, i) = x.u[i]
238+
236239
function responsible_map(f, II...)
237-
batch_data = Vector{Core.Compiler.return_type(f, Tuple{typeof.(getindex.(II, 1))...})}(
240+
batch_data = Vector{Core.Compiler.return_type(
241+
f, Tuple{ntuple(i -> typeof(__getindex(II[i], 1)), Val(length(II)))...})}(
238242
undef,
239243
length(II[1]))
240244
for i in 1:length(II[1])
241-
batch_data[i] = f(getindex.(II, i)...)
245+
batch_data[i] = f(ntuple(ii -> __getindex(II[ii], i), Val(length(II)))...)
242246
end
243247
batch_data
244248
end

0 commit comments

Comments
 (0)