-
Notifications
You must be signed in to change notification settings - Fork 89
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
Removes rules depending on casted #120
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple questions, but the changes LGTM as is
@@ -59,7 +59,7 @@ end | |||
|
|||
function rrule(::typeof(sum), x) | |||
function sum_pullback(ȳ) | |||
return (NO_FIELDS, cast(ȳ)) | |||
return (NO_FIELDS, @thunk(fill(ȳ, size(x)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we consider using Fill
from FillArrays
instead of fill
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's definitely a thing we're going to do, but at a later date, just to avoid the added complexity for now (we don't want to have to deal with any FillArray
-specific issues that aren't really ChainRules
things for the time being)
Δz = randn(rng) | ||
|
||
frule_test(hypot, (x, Δx), (y, Δy)) | ||
rrule_test(hypot, Δz, (x, x̄), (y, ȳ)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there a reason these use frule_test
but the tests for e.g. atan2
call frule
then test the output.
Is it because the atan2
tests pre-date frule_test
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it because the atan2 tests pre-date frule_test?
I suspect that this is the case. Will open an issue and resolve at a later date.
Matches to JuliaDiff/ChainRulesCore.jl#55
There is also a surprisingly large change to
hypot
's testsas they were AFAWCT nonsense.