Skip to content

Check frule primal with isapprox#46

Merged
sethaxen merged 6 commits intoJuliaDiff:masterfrom
sethaxen:fruleapprox
Jun 29, 2020
Merged

Check frule primal with isapprox#46
sethaxen merged 6 commits intoJuliaDiff:masterfrom
sethaxen:fruleapprox

Conversation

@sethaxen
Copy link
Member

frule_test currently requires the primal output of frule of f to be exactly equal to the output of f. We previously relaxed this requirement for rrule_test (#33), and this PR just uses the same check for frule_test.

The ChainRules test suite still passes for me with this change.

@willtebbutt
Copy link
Member

Hmm my concern is that this is going to break when the functions output objects for which isapprox is not defined, such as Tuples. I don't think that we test enough things in this package to be sure that this won't break lots of things downstream unfortunately. Possibly we need to implement our own function to check approximate equality. @oxinabox any thoughts?

@sethaxen
Copy link
Member Author

Yes, rrule_test has this same limitation. One easy thing we could do for both frule_test and rrule_test would be conduct a strict equality check first, followed by an approximate equality check if that fails. This would ensure that this test passes for everything it currently passes for.

@willtebbutt
Copy link
Member

Hmm yeah, I would definitely be on board with that as a short- to medium-term solution.

@sethaxen
Copy link
Member Author

Okay, I added back the equality check first, and I did the same thing for rrule_test.

Copy link
Member

@willtebbutt willtebbutt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@sethaxen sethaxen merged commit 250dfac into JuliaDiff:master Jun 29, 2020
@sethaxen sethaxen deleted the fruleapprox branch June 29, 2020 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants