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
Make reshape and view on Memory produce Arrays and delete wrap (#53896)
- Make reshape and view with one based indexing on Memory produce Arrays
- delete wrap
Implements
#53552 (comment)
---------
Co-authored-by: Jameson Nash <[email protected]>
(cherry picked from commit 273d91e)
"Attempted to wrap a MemoryRef of length $len with an Array of size dims=$dims, which is invalid because prod(dims) = $proddims > $len, so that the array would have more elements than the underlying memory can store."))
3094
-
3095
-
@eval@propagate_inboundsfunctionwrap(::Type{Array}, m::MemoryRef{T}, dims::NTuple{N, Integer}) where {T, N}
3096
-
dims =convert(Dims, dims)
3097
-
ref =_wrap(m, dims)
3098
-
$(Expr(:new, :(Array{T, N}), :ref, :dims))
3099
-
end
3100
-
3101
-
@eval@propagate_inboundsfunctionwrap(::Type{Array}, m::Memory{T}, dims::NTuple{N, Integer}) where {T, N}
3102
-
dims =convert(Dims, dims)
3103
-
ref =_wrap(MemoryRef(m), dims)
3104
-
$(Expr(:new, :(Array{T, N}), :ref, :dims))
3105
-
end
3106
-
@eval@propagate_inboundsfunctionwrap(::Type{Array}, m::MemoryRef{T}, l::Integer) where {T}
3107
-
dims = (Int(l),)
3108
-
ref =_wrap(m, dims)
3109
-
$(Expr(:new, :(Array{T, 1}), :ref, :dims))
3110
-
end
3111
-
@eval@propagate_inboundsfunctionwrap(::Type{Array}, m::Memory{T}, l::Integer) where {T}
3112
-
dims = (Int(l),)
3113
-
ref =_wrap(MemoryRef(m), (l,))
3114
-
$(Expr(:new, :(Array{T, 1}), :ref, :dims))
3115
-
end
3116
-
@eval@propagate_inboundsfunctionwrap(::Type{Array}, m::Memory{T}) where {T}
0 commit comments