Skip to content

Commit

Permalink
add getindex slice method for vector of numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
lxvm committed Feb 27, 2024
1 parent 458d900 commit d06b8a6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/vector_of_array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,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},

Check warning on line 307 in src/vector_of_array.jl

View check run for this annotation

Codecov / codecov/patch

src/vector_of_array.jl#L307

Added line #L307 was not covered by tests
::NotSymbolic, I::Colon...) where {T <: Number, N}
@assert length(I) == ndims(A.u)
return A.u[I...]

Check warning on line 310 in src/vector_of_array.jl

View check run for this annotation

Codecov / codecov/patch

src/vector_of_array.jl#L309-L310

Added lines #L309 - L310 were not covered by tests
end

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

0 comments on commit d06b8a6

Please sign in to comment.