Skip to content

Commit 7f33ba4

Browse files
committed
Fix slicing of GradedArrays
1 parent 3cf1b66 commit 7f33ba4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/abstractblocksparsearray/arraylayouts.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ function ArrayLayouts.sub_materialize(layout::BlockLayout{<:SparseLayout}, a, ax
6262
# TODO: Use `similar`?
6363
blocktype_a = blocktype(parent(a))
6464
a_dest = BlockSparseArray{eltype(a), length(axes), blocktype_a}(undef, axes)
65-
a_dest .= a
65+
for I in SparseArraysBase.eachstoredindex(blocks(a))
66+
b = Block(Tuple(I))
67+
a_dest[b] = blocks(a)[Tuple(I)...]
68+
end
6669
return a_dest
6770
end
6871

0 commit comments

Comments
 (0)