-
Notifications
You must be signed in to change notification settings - Fork 100
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
Use ChainRulesCore.@not_implemented
and extend tests
#308
Conversation
Codecov Report
@@ Coverage Diff @@
## master #308 +/- ##
==========================================
+ Coverage 89.28% 89.31% +0.02%
==========================================
Files 12 12
Lines 2633 2640 +7
==========================================
+ Hits 2351 2358 +7
Misses 282 282
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Yeah. |
(hankelh2(ν - 1, x) - hankelh2(ν + 1, x)) / 2, | ||
), | ||
) | ||
ChainRulesCore.@scalar_rule( | ||
polygamma(m, x), | ||
( | ||
ChainRulesCore.@thunk(error("not implemented")), | ||
ChainRulesCore.DoesNotExist(), |
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.
Why wasn't it already the case?
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.
I guess I did not pay enough attention when I moved the rules from ChainRules and just replaced all NaN
with @thunk(error("not implemented"))
(https://github.com/JuliaDiff/ChainRules.jl/blob/bf54b2f0e77fb05d3bc42004c448b3db0432f9cd/src/rulesets/packages/SpecialFunctions.jl#L57).
This PR updates the differentials to use the new
@not_implemented
macro instead of custom thunks witherror("not implemented")
. Additionally, now all differentials are tested.The update to
@not_implemented
has multiple advantages:SpecialFunctions.bessel...
errors with SpecialFunctions >= 1 - support thunks? FluxML/Zygote.jl#873: now it is possible to use even incomplete rules with ZygoteI assume the rules in ChainRules should be updated in the same way @oxinabox?