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

Broadcast with missing destroys sparsity #54467

Closed
LilithHafner opened this issue May 14, 2024 · 0 comments · Fixed by #54469
Closed

Broadcast with missing destroys sparsity #54467

LilithHafner opened this issue May 14, 2024 · 0 comments · Fixed by #54469
Labels
domain:missing data Base.missing and related functionality kind:bug Indicates an unexpected problem or unintended behavior

Comments

@LilithHafner
Copy link
Member

julia> f(x, y) = x
f (generic function with 1 method)

julia> f.(Diagonal([1,2,3]), nothing)
3×3 Diagonal{Int64, Vector{Int64}}:
 1    
   2  
     3

julia> f.(Diagonal([1,2,3]), 6)
3×3 Diagonal{Int64, Vector{Int64}}:
 1    
   2  
     3

julia> f.(Diagonal([1,2,3]), missing)
3×3 Matrix{Int64}:
 1  0  0
 0  2  0
 0  0  3

This is due to the use of missing as a sentinel in LinearAlgebra/src/struguredbroadcast.jl internals.

@LilithHafner LilithHafner added the kind:bug Indicates an unexpected problem or unintended behavior label May 14, 2024
@LilithHafner LilithHafner added the domain:missing data Base.missing and related functionality label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:missing data Base.missing and related functionality kind:bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant