Skip to content

Commit 458d900

Browse files
committed
Revert "Update vector_of_array.jl"
This reverts commit 49d6742.
1 parent 6aea2ab commit 458d900

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
@@ -296,7 +296,13 @@ __parameterless_type(T) = Base.typename(T).wrapper
296296
Base.@propagate_inbounds function _getindex(A::AbstractVectorOfArray{T, N},
297297
::NotSymbolic, I::Colon...) where {T, N}
298298
@assert length(I) == ndims(A.u[1]) + 1
299-
return Array(A)
299+
vecs = if N == 1
300+
A.u
301+
else
302+
vec.(A.u)
303+
end
304+
return Adapt.adapt(__parameterless_type(T),
305+
reshape(reduce(hcat, vecs), size(A.u[1])..., length(A.u)))
300306
end
301307

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

0 commit comments

Comments
 (0)