Skip to content

ArrayPartition copyto! dimension mismatch with Array{T,N} where N>1 #68

@nantonel

Description

@nantonel

Using Julia 1.1.1:

julia> using RecursiveArrayTools

julia> x = ArrayPartition(rand(10,10),rand(10));

julia> y = zero(x);

julia> copyto!(y,x)
ERROR: DimensionMismatch("array could not be broadcast to match destination")
Stacktrace:
 [1] copyto!(::ArrayPartition{Float64,Tuple{Array{Float64,2},Array{Float64,1}}}, ::ArrayPartition{Float64,Tuple{Array{Float64,2},Array{Float64,1}}}) at ./broadcast.jl:456
 [2] top-level scope at none:0

I've notice there's no error when ArrayPartition is constructed using only vectors:

julia> x = ArrayPartition(rand(2), rand(10)+im.*randn(10));

julia> y = zero(x);

julia> copyto!(y,x)

Seems to be related to #67, but I've opened a new issue because the error I get is different.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions