Using ArrayInterface v5.05 and StaticArrays v1.42:
julia> import ArrayInterface as Arr
julia> using StaticArrays
julia> Arr.known_size(SArray{Tuple{2,3}})
(6,)
julia> Arr.size(StaticArray{Tuple{2,3}})
(static(6),)
Are those the intended results? I expected (2, 3) and (static(2), static(3)), respectively. (Though, things work fine for instances of StaticArrays.)
I think what is happening is that IteratorSize(::Type{<:StaticArray}) is defaulting to HasLength() while it might better off be HasShape{N}(), so the wrong method gets called at some point. If that's the case, perhaps its also worth opening a bug report on StaticArrays.
Also, should ArrayInterface.size produce an error if given a Type as an argument? What should be the behavior if one of the dimensions is unknown?
Using
ArrayInterface v5.05andStaticArrays v1.42:Are those the intended results? I expected
(2, 3)and(static(2), static(3)), respectively. (Though, things work fine for instances ofStaticArrays.)I think what is happening is that
IteratorSize(::Type{<:StaticArray})is defaulting toHasLength()while it might better off beHasShape{N}(), so the wrong method gets called at some point. If that's the case, perhaps its also worth opening a bug report onStaticArrays.Also, should
ArrayInterface.sizeproduce an error if given aTypeas an argument? What should be the behavior if one of the dimensions is unknown?