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

Add BroadcastThunk #615

Closed
wants to merge 4 commits into from
Closed

Add BroadcastThunk #615

wants to merge 4 commits into from

Conversation

mcabbott
Copy link
Member

@codecov
Copy link

codecov bot commented Mar 22, 2023

Codecov Report

Patch coverage: 78.12% and project coverage change: -1.07 ⚠️

Comparison is base (79ba4ef) 94.10% compared to head (a4b2b64) 93.03%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #615      +/-   ##
==========================================
- Coverage   94.10%   93.03%   -1.07%     
==========================================
  Files          14       14              
  Lines         899      962      +63     
==========================================
+ Hits          846      895      +49     
- Misses         53       67      +14     
Impacted Files Coverage Δ
src/ChainRulesCore.jl 100.00% <ø> (ø)
src/tangent_types/thunks.jl 88.75% <66.66%> (-7.16%) ⬇️
src/accumulation.jl 95.00% <75.00%> (-2.23%) ⬇️
src/projection.jl 97.26% <100.00%> (+0.21%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

src/accumulation.jl Outdated Show resolved Hide resolved
This removes most thunks, but turns a `BroadcastThunk` into a `Broadcasted`.
For use in rrules which can handle the latter.
"""
unthunk_or_bc(x) = unthunk(x)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe unthunk should do this on BroadcastedThunks?
Rather than a seperate function?
idk maybe not since Broadcasted isn't a linear algrebra type.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If your rule used to call unthunk and get an array, then it may fail if a new kind of thunk doesn't respect that.

Agree it adds complexity to have two unwrap-this functions.

@mcabbott mcabbott closed this Mar 27, 2024
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.

2 participants