You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As @MasonProtter points out in slack, this is the offending method in Base
functionaxes(a::NonReshapedReinterpretArray{T,N,S}where {N}) where {T,S}
paxs =axes(a.parent)
f, l =first(paxs[1]), length(paxs[1])
size1 =issingletontype(T) ? l :div(l*sizeof(S), sizeof(T))
tuple(oftype(paxs[1], f:f+size1-1), tail(paxs)...)
end
The error stems from oftype not receiving enough type-domain information to yield the correct SOneTo axis object. Mason also suggests the following kind of fix in StaticArrays.jl
function Base.axes(::Base.NonReshapedReinterpretArray{T, N, S, SA}) where {T, N, S, SA <:StaticArray{Tup}} where {Tup}
paxs =axes(SA)
old_sizes =size(SA)
l = old_sizes[1]
size1 = Base.issingletontype(T) ? l :div(l*sizeof(S), sizeof(T))
(SOneTo(size1), SOneTo.(Base.tail(old_sizes))...)
end
and an analogous method for Base.axes(::ReshapedReinterpretArray{T,N,S} where {N}) where {T,S}
The text was updated successfully, but these errors were encountered:
pablosanjose
changed the title
reinterpret failure due to missing axis specializationreinterpret failure due to missing axes specialization
Jun 30, 2024
As @MasonProtter points out in slack, this is the offending method in Base
The error stems from
oftype
not receiving enough type-domain information to yield the correctSOneTo
axis object. Mason also suggests the following kind of fix in StaticArrays.jland an analogous method for
Base.axes(::ReshapedReinterpretArray{T,N,S} where {N}) where {T,S}
The text was updated successfully, but these errors were encountered: