Closed kylebd99 closed 5 months ago
Attention: Patch coverage is 92.00000%
with 2 lines
in your changes are missing coverage. Please review.
Project coverage is 76.33%. Comparing base (
65cfaf7
) to head (d054a7e
).
Files | Patch % | Lines |
---|---|---|
src/interface/lazy.jl | 91.66% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Looks good to me! Could you also add an eager version for Tensor and SwizzleArray? I think the specialization is something like Base.getindex(tns::Tensor, idxs::Vararg{<:Union{Colon, Nothing}}) = compute(lazy(tns)[idxs...])
What's the intended behavior for eager? It seems like the :/nothing construct is primarily meant for expressing lazy computation.
I think it would just eagerly insert a length-1 dimension? I was asking mostly because all of the constructs usually have an eager counterpart. Though no worries if you'd rather not add it here, we can skip it for now and add it later.
Hmm for the moment, I might leave it. I think implementing this would require adjusting the swizzle array code as well to allow for new dimensions to be inserted. Currently, it looks like it assumes that the permutation is the same number of dimensions as the tensor.
This PR adds a minimal form of lazy indexing to allow for empty dimensions.