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

Widen activation broadcast rules #433

Merged
merged 2 commits into from
Aug 15, 2022
Merged

Widen activation broadcast rules #433

merged 2 commits into from
Aug 15, 2022

Conversation

mcabbott
Copy link
Member

@mcabbott mcabbott commented Aug 15, 2022

In something like relu.(x .+ b), the broadcast rule for .+ in Zygote always makes an array, but the rule in ChainRules makes a Broadcasted to permit fusion. In that case the rule for relu.(x::Numeric) here won't currently be called; so this PR widens its signature. As suggested here: #432 (comment)

Copy link
Member

@ToucheSir ToucheSir left a comment

Choose a reason for hiding this comment

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

Is there any way to test the Broadcasted case? Otherwise LGTM.

@mcabbott
Copy link
Member Author

I added a test. I think it'll also fail with sufficiently old CR.jl, but maybe that's OK.

@mcabbott mcabbott merged commit 5dd04df into master Aug 15, 2022
@mcabbott mcabbott deleted the mcabbott-patch-1 branch August 15, 2022 17:58
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