-
-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1089: Fix broadcasting `-` with booleans r=mcabbott a=mcabbott Closes #1086 The issue is that `unbroadcast` collapses the gradient of a non-differentiable argument to `nothing`, Zygote's marker for such things, which the rule then tried to negate. (This is why CRC defines its own zero types for this purpose, instead of using nothing). I presume the original reason for `-unbroadcast(y, Δ)` not `unbroadcast(y, -Δ)` is to save an allocation when `y` is a scalar etc. I did not see any other cases where further operations are done after `unbroadcast`. Co-authored-by: Michael Abbott <32575566+mcabbott@users.noreply.github.com>
- Loading branch information
Showing
3 changed files
with
9 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters