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
"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."))
3089
-
3090
-
@eval@propagate_inboundsfunctionwrap(::Type{Array}, m::MemoryRef{T}, dims::NTuple{N, Integer}) where {T, N}
3091
-
dims =convert(Dims, dims)
3092
-
ref =_wrap(m, dims)
3093
-
$(Expr(:new, :(Array{T, N}), :ref, :dims))
3094
-
end
3095
-
3096
-
@eval@propagate_inboundsfunctionwrap(::Type{Array}, m::Memory{T}, dims::NTuple{N, Integer}) where {T, N}
3097
-
dims =convert(Dims, dims)
3098
-
ref =_wrap(MemoryRef(m), dims)
3099
-
$(Expr(:new, :(Array{T, N}), :ref, :dims))
3100
-
end
3101
-
@eval@propagate_inboundsfunctionwrap(::Type{Array}, m::MemoryRef{T}, l::Integer) where {T}
3102
-
dims = (Int(l),)
3103
-
ref =_wrap(m, dims)
3104
-
$(Expr(:new, :(Array{T, 1}), :ref, :dims))
3105
-
end
3106
-
@eval@propagate_inboundsfunctionwrap(::Type{Array}, m::Memory{T}, l::Integer) where {T}
3107
-
dims = (Int(l),)
3108
-
ref =_wrap(MemoryRef(m), (l,))
3109
-
$(Expr(:new, :(Array{T, 1}), :ref, :dims))
3110
-
end
3111
-
@eval@propagate_inboundsfunctionwrap(::Type{Array}, m::Memory{T}) where {T}
_bcs1(a::Integer, b::Integer) = a ==1? b : (b ==1? a : (a == b ? a :throw(DimensionMismatch("arrays could not be broadcast to a common size; got a dimension with lengths $aand $b"))))
521
-
_bcs1(a::Integer, b) = a ==1? b : (first(b) ==1&&last(b) == a ? b :throw(DimensionMismatch("arrays could not be broadcast to a common size; got a dimension with lengths $aand $(length(b))")))
520
+
_bcs1(a::Integer, b::Integer) = a ==1? b : (b ==1? a : (a == b ? a :throw(DimensionMismatch(LazyString("arrays could not be broadcast to a common size; got a dimension with lengths ", a, "and ", b)))))
521
+
_bcs1(a::Integer, b) = a ==1? b : (first(b) ==1&&last(b) == a ? b :throw(DimensionMismatch(LazyString("arrays could not be broadcast to a common size; got a dimension with lengths ", a, "and ", length(b)))))
522
522
_bcs1(a, b::Integer) =_bcs1(b, a)
523
523
_bcs1(a, b) =_bcsm(b, a) ?axistype(b, a) :_bcsm(a, b) ?axistype(a, b) :throw(DimensionMismatch(LazyString("arrays could not be broadcast to a common size: a has axes ", a, " and b has axes ", b)))
524
524
# _bcsm tests whether the second index is consistent with the first
@@ -1057,7 +1057,7 @@ end
1057
1057
1058
1058
1059
1059
@noinlinethrowdm(axdest, axsrc) =
1060
-
throw(DimensionMismatch("destination axes $axdestare not compatible with source axes $axsrc"))
1060
+
throw(DimensionMismatch(LazyString("destination axes ", axdest, "are not compatible with source axes ", axsrc)))
1061
1061
1062
1062
functionrestart_copyto_nonleaf!(newdest, dest, bc, val, I, iter, state, count)
1063
1063
# Function barrier that makes the copying to newdest type stable
0 commit comments