-
Notifications
You must be signed in to change notification settings - Fork 95
Handle Base.hypot with more than 2 arguments #824
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
Conversation
Co-authored-by: David Müller-Widmann <[email protected]>
|
Thanks for the suggestions @devmotion. The CI errors seems to be consistent with, e.g., the most recently merged commit. But the new hypot tests in base.jl seem to have passed. |
| test_rrule(merge, (; a=1.0), (; a=2.0)) | ||
| end | ||
|
|
||
| @testset "hypot(x, y, z, xs...)" begin |
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.
Can you also add tests with mixed Real/Complex inputs?
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.
Updated to test mixed inputs. The new tests are passing; CI failures are the same as before.
Currently, there are rules for
hypot(x)andhypot(x, y), butBasedefineshypot(x, y, xs...), which is not handled by ChainRules. The two-argument case is infastmath_able, butBase.FastMathonly supports the two-argument method, so this PR adds separate forward and reverse rules specifically for 3 arguments, with aVarargon the end, to handle the remaining possibilities. These new rules are just mild generalizations of the two-argument rules.