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]>
"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."))
3107
-
3108
-
@eval@propagate_inboundsfunctionwrap(::Type{Array}, m::MemoryRef{T}, dims::NTuple{N, Integer}) where {T, N}
3109
-
dims =convert(Dims, dims)
3110
-
ref =_wrap(m, dims)
3111
-
$(Expr(:new, :(Array{T, N}), :ref, :dims))
3112
-
end
3113
-
3114
-
@eval@propagate_inboundsfunctionwrap(::Type{Array}, m::Memory{T}, dims::NTuple{N, Integer}) where {T, N}
3115
-
dims =convert(Dims, dims)
3116
-
ref =_wrap(MemoryRef(m), dims)
3117
-
$(Expr(:new, :(Array{T, N}), :ref, :dims))
3118
-
end
3119
-
@eval@propagate_inboundsfunctionwrap(::Type{Array}, m::MemoryRef{T}, l::Integer) where {T}
3120
-
dims = (Int(l),)
3121
-
ref =_wrap(m, dims)
3122
-
$(Expr(:new, :(Array{T, 1}), :ref, :dims))
3123
-
end
3124
-
@eval@propagate_inboundsfunctionwrap(::Type{Array}, m::Memory{T}, l::Integer) where {T}
3125
-
dims = (Int(l),)
3126
-
ref =_wrap(MemoryRef(m), (l,))
3127
-
$(Expr(:new, :(Array{T, 1}), :ref, :dims))
3128
-
end
3129
-
@eval@propagate_inboundsfunctionwrap(::Type{Array}, m::Memory{T}) where {T}
0 commit comments