Skip to content

Commit 96a09f3

Browse files
committed
Revert "Update vector_of_array.jl"
This reverts commit 49d6742.
1 parent c668130 commit 96a09f3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/vector_of_array.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,13 @@ __parameterless_type(T) = Base.typename(T).wrapper
270270
Base.@propagate_inbounds function _getindex(A::AbstractVectorOfArray{T, N},
271271
::NotSymbolic, I::Colon...) where {T, N}
272272
@assert length(I) == ndims(A.u[1]) + 1
273-
return Array(A)
273+
vecs = if N == 1
274+
A.u
275+
else
276+
vec.(A.u)
277+
end
278+
return Adapt.adapt(__parameterless_type(T),
279+
reshape(reduce(hcat, vecs), size(A.u[1])..., length(A.u)))
274280
end
275281

276282
Base.@propagate_inbounds function _getindex(A::AbstractVectorOfArray{T, N},

0 commit comments

Comments
 (0)