Uh oh!
There was an error while loading. Please reload this page.
Added ldexp to list of diffrules - #73
Conversation
Added a rule for the function ldexp https://docs.julialang.org/en/v1/base/math/#Base.Math.ldexp
Uh oh!
There was an error while loading. Please reload this page.
use exp2 instead of 2^x to avoid overflows, indicate the derivative w.r.t. the second argument of ldexp as not defined since that argument is of integer type. Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
… be an integer and thus non-differentiable. Changed variable name from "non_numeric_arg_functions" to "non_diffable_arg_functions" to be more general and account for the numeric but non-differentiable nature of the second argument of ldexp.
david-hofmann
commented
Dec 7, 2021
Dear @devmotion , I have now also added a special test rule for ldexp. I tested it locally and I think it works as it is supposed to but the test errors still remain. However, as far as I can see it doesn't have anything to do with my code additions or am I missing something? Can I do anything to move forward with the PR? Thank you! |
david-hofmann
commented
Dec 7, 2021
Ah, no, nevermind, I see that some are still related to |
david-hofmann
commented
Dec 8, 2021
Okay, I see that at least the issues with the downstream tests of |
devmotion
commented
Dec 11, 2021
The problem is that these packages define differentiation rules based on the rules in DiffRules automatically and then also test them automatically, without taking into account the types of the arguments of these functions. Of course, this is problematic already for existing rules such as the one for It would be nice for maintainers of these downstream packages if you could prepare PRs that skip these automatic tests also for |
ChrisRackauckas
commented
Dec 12, 2021
Then let's just merge and leave the rest to downstream? |
Codecov Report
@@ Coverage Diff @@## master #73 +/- ##
==========================================
+ Coverage 96.95% 96.96% +0.01%
==========================================
Files 3 3 Lines 164 165 +1 ==========================================
+ Hits 159 160 +1
Misses 5 5
Continue to review full report at Codecov.
|
devmotion
commented
Dec 12, 2021
Fine with me. I merged the master branch, this should fix the other test errors. |
mcabbott
left a comment
There was a problem hiding this comment.
Seems OK, breaks ForwardDiff's tests but won't break actual usage.
devmotion
commented
Dec 12, 2021
Thank you @david-hofmann! |
Added a rule for the function ldexp