-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Description
Sorry if this is a duplicate of an existing issue, but I'd like to recommend 2 improvements to rrule_test.
- relax the equality check of the outputs to use
isapprox. Sometimes a slightly different algorithm is used to compute the output when doing AD and will cause a strict equality test to fail. e.g. the reverse-mode derivatives ofeigvals(::Symmetric)useseigen(::Symmetric), which produces approximately the same eigvals but not identical: https://github.com/FluxML/Zygote.jl/blob/0b3e32d5c0f8e5ef3b061a6f84ed5505f5a202a0/src/lib/array.jl#L590-L593 - If the function returns a tuple of outputs or any of the arguments are tuples, iterate over them.
I had adapted rrule_test for some Zygote functions and implemented these changes: https://gist.github.com/sethaxen/fa67e541c4a2a5e773b475349ed87fb9/677f58af483e270fc5bdc1a318825e9fef1b0256#file-zygote_power_series_tests-jl-L4-L48
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels