Closed mtsokol closed 7 months ago
Hi @willow-ahrens,
I wanted to adjust similar tests for SingleList and SingleRLE but I noticed that these levels can't be used in 2-dim tensors:
similar
SingleList
SingleRLE
using Finch arr = [0.0, 0.0, 2.0, 0.0, 0.0, 0.0] dropdefaults!(Tensor(SingleList(Element(zero(eltype(arr))))), arr) # passes # restart interpreter using Finch mt = Matrix(reshape(1:25, (5, 5))) dropdefaults!(Tensor(Dense(SingleList(Element(zero(eltype(mt)))))), mt) # fails
ERROR: Finch.FinchProtocolError("SingleListLevels can only be updated once") Stacktrace: [1] macro expansion @ ~/JuliaProjects/Finch.jl/src/tensors/levels/singlelistlevels.jl:346 [inlined] [2] macro expansion @ ~/JuliaProjects/Finch.jl/src/looplets/lookups.jl:344 [inlined] [3] macro expansion @ ~/JuliaProjects/Finch.jl/src/environment.jl:50 [inlined]
I don't think this is a bug. The SingleListLevel is only capable of representing a single nonzero, but Matrix(reshape(1:25, (5, 5))) has 25 nonzeros
Matrix(reshape(1:25, (5, 5)))
Ah, I missed that - thank you for an explanation!
Hi @willow-ahrens,
I wanted to adjust
similar
tests forSingleList
andSingleRLE
but I noticed that these levels can't be used in 2-dim tensors: