Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in broadcasting between blockarray and normal array #223

Open
KristofferC opened this issue Sep 20, 2022 · 2 comments
Open

Regression in broadcasting between blockarray and normal array #223

KristofferC opened this issue Sep 20, 2022 · 2 comments
Milestone

Comments

@KristofferC
Copy link
Collaborator

This used to work on 0.16.3:

a = PseudoBlockArray(zeros(10 + 12, 10 + 12), [10, 12], [10, 12]) 
b = rand(22, 22)
a .+= b .* 1.0

It currently errors with:

ERROR: DimensionMismatch("array could not be broadcast to match destination")
Stacktrace:
  [1] check_broadcast_shape
    @ ./broadcast.jl:540 [inlined]
  [2] check_broadcast_axes
    @ ./broadcast.jl:543 [inlined]
  [3] check_broadcast_axes
    @ ./broadcast.jl:547 [inlined]
  [4] instantiate
    @ ./broadcast.jl:284 [inlined]
  [5] materialize!
    @ ./broadcast.jl:871 [inlined]
  [6] materialize!
    @ ./broadcast.jl:868 [inlined]
  [7] broadcast!(::typeof(+), ::SubArray{Float64, 2, Matrix{Float64}, Tuple{UnitRange{Int64}, UnitRange{Int64}}, false}, ::SubArray{Float64, 2, Matrix{Float64}, Tuple{UnitRange{Int64}, UnitRange{Int64}}, false}, ::Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{2}, Nothing, typeof(*), Tuple{Matrix{Float64}, Float64}})
    @ Base.Broadcast ./broadcast.jl:837
  [8] macro expansion
    @ ~/.julia/packages/BlockArrays/B2UXn/src/blockbroadcast.jl:175 [inlined]
  [9] _generic_blockbroadcast_copyto!(dest::PseudoBlockMatrix{Float64, Matrix{Float64}, Tuple{BlockedUnitRange{Vector{Int64}}, BlockedUnitRange{Vector{Int64}}}}, bc::Base.Broadcast.Broadcasted{BlockArrays.PseudoBlockStyle{2}, Tuple{BlockedUnitRange{Vector{Int64}}, BlockedUnitRange{Vector{Int64}}}, typeof(+), Tuple{PseudoBlockMatrix{Float64, Matrix{Float64}, Tuple{BlockedUnitRange{Vector{Int64}}, BlockedUnitRange{Vector{Int64}}}}, Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{2}, Nothing, typeof(*), Tuple{Matrix{Float64}, Float64}}}})
    @ BlockArrays ~/.julia/packages/BlockArrays/B2UXn/src/blockbroadcast.jl:151
 [10] copyto!(dest::PseudoBlockMatrix{Float64, Matrix{Float64}, Tuple{BlockedUnitRange{Vector{Int64}}, BlockedUnitRange{Vector{Int64}}}}, bc::Base.Broadcast.Broadcasted{BlockArrays.PseudoBlockStyle{2}, Tuple{BlockedUnitRange{Vector{Int64}}, BlockedUnitRange{Vector{Int64}}}, typeof(+), Tuple{PseudoBlockMatrix{Float64, Matrix{Float64}, Tuple{BlockedUnitRange{Vector{Int64}}, BlockedUnitRange{Vector{Int64}}}}, Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{2}, Nothing, typeof(*), Tuple{Matrix{Float64}, Float64}}}})
    @ BlockArrays ~/.julia/packages/BlockArrays/B2UXn/src/blockbroadcast.jl:193
 [11] materialize!(dest::PseudoBlockMatrix{Float64, Matrix{Float64}, Tuple{BlockedUnitRange{Vector{Int64}}, BlockedUnitRange{Vector{Int64}}}}, bc::Base.Broadcast.Broadcasted{BlockArrays.PseudoBlockStyle{2}, Nothing, typeof(+), Tuple{PseudoBlockMatrix{Float64, Matrix{Float64}, Tuple{BlockedUnitRange{Vector{Int64}}, BlockedUnitRange{Vector{Int64}}}}, Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{2}, Nothing, typeof(*), Tuple{Matrix{Float64}, Float64}}}})
    @ BlockArrays ~/.julia/packages/BlockArrays/B2UXn/src/blockbroadcast.jl:148
 [12] top-level scope
    @ REPL[4]:1
@dlfivefifty
Copy link
Member

There's no obvious culprit I can see so will take some time to debug

@KristofferC
Copy link
Collaborator Author

Introduced in 4d1e02f

@dlfivefifty dlfivefifty added this to the v1.0 milestone Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants