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

Handling zero sized blocks in assignment with broadcast and operation on self #444

Open
krcools opened this issue Jan 8, 2025 · 1 comment

Comments

@krcools
Copy link

krcools commented Jan 8, 2025

This looks like it might be related to #203 , but I am reporting this for completeness. Assignment in combination with broadcasting does not handle zero-sized blocks correctly:

julia> y = BlockedArray([2.0, 3.0], [1,0,1])
3-blocked 2-element BlockedVector{Float64}:
 2.0
 ───
 3.0

julia> z = y .+ 100.0  # correct result
3-blocked 2-element BlockedVector{Float64}:
 102.0
 ─────
 103.0

julia> y .+= 100.0 # second block is not acted upon
3-blocked 2-element BlockedVector{Float64}:
 102.0
 ─────
   3.0
@dlfivefifty
Copy link
Member

Nice catch! A PR to fix this would be greatly appreciated.

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