From d55dac2933bc7458a5a882e777e7d5e389d5c1ed Mon Sep 17 00:00:00 2001 From: lxvm Date: Mon, 26 Feb 2024 23:18:16 -0500 Subject: [PATCH] add getindex slice method for vector of numbers --- src/vector_of_array.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/vector_of_array.jl b/src/vector_of_array.jl index c563ce61..a7a16005 100644 --- a/src/vector_of_array.jl +++ b/src/vector_of_array.jl @@ -278,6 +278,11 @@ Base.@propagate_inbounds function _getindex(A::AbstractVectorOfArray{T, N}, return Adapt.adapt(__parameterless_type(T), reshape(reduce(hcat, vecs), size(A.u[1])..., length(A.u))) end +Base.@propagate_inbounds function _getindex(A::AbstractVectorOfArray{T, N}, + ::NotSymbolic, I::Colon...) where {T <: Number, N} + @assert length(I) == ndims(A.u) + return A.u[I...] +end Base.@propagate_inbounds function _getindex(A::AbstractVectorOfArray{T, N}, ::NotSymbolic, I::AbstractArray{Bool},