Skip to content

Broadcast operations for arbitrary styles#408

Open
jishnub wants to merge 2 commits into
masterfrom
jishnub/broadcasted
Open

Broadcast operations for arbitrary styles#408
jishnub wants to merge 2 commits into
masterfrom
jishnub/broadcasted

Conversation

@jishnub

@jishnub jishnub commented Mar 12, 2025

Copy link
Copy Markdown
Member

In many broadcast operations that take an AbstractFill and produce another AbstractFill, the result should hold irrespective of the broadcast style involved. We may therefore specialize broadcast(op, F::AbstractFill) without caring about the BroadcastStyle of F.

E.g.:

julia> E = Eye(∞)
ℵ₀×ℵ₀ LinearAlgebra.Diagonal{Float64, Ones{Float64, 1, Tuple{InfiniteArrays.OneToInf{Int64}}}} with indices OneToInf()×OneToInf()

julia> E^2
ℵ₀×ℵ₀ LinearAlgebra.Diagonal{Float64, Ones{Float64, 1, Tuple{InfiniteArrays.OneToInf{Int64}}}} with indices OneToInf()×OneToInf()

This is a result that should hold irrespective of what the broadcast style of the diagonal is. Currently,

julia> Broadcast.BroadcastStyle(typeof(E))
LazyArrays.LazyArrayStyle{2}()

julia> Broadcast.BroadcastStyle(typeof(E.diag))
Base.Broadcast.DefaultArrayStyle{1}()

but if the style of E.diag is also changed to a LazyArrayStyle, the result of E^2 should remain unchanged.

@codecov

codecov Bot commented Mar 12, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.04%. Comparing base (877375f) to head (c2deb57).
⚠️ Report is 16 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #408      +/-   ##
==========================================
- Coverage   99.48%   99.04%   -0.44%     
==========================================
  Files           8        8              
  Lines        1157     1157              
==========================================
- Hits         1151     1146       -5     
- Misses          6       11       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Successfully merging this pull request may close these issues.

1 participant