Skip to content

Commit d06b8a6

Browse files
committed
add getindex slice method for vector of numbers
1 parent 458d900 commit d06b8a6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/vector_of_array.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,11 @@ Base.@propagate_inbounds function _getindex(A::AbstractVectorOfArray{T, N},
304304
return Adapt.adapt(__parameterless_type(T),
305305
reshape(reduce(hcat, vecs), size(A.u[1])..., length(A.u)))
306306
end
307+
Base.@propagate_inbounds function _getindex(A::AbstractVectorOfArray{T, N},
308+
::NotSymbolic, I::Colon...) where {T <: Number, N}
309+
@assert length(I) == ndims(A.u)
310+
return A.u[I...]
311+
end
307312

308313
Base.@propagate_inbounds function _getindex(A::AbstractVectorOfArray{T, N},
309314
::NotSymbolic, I::AbstractArray{Bool},

0 commit comments

Comments
 (0)