-
Notifications
You must be signed in to change notification settings - Fork 65
Allow to sum NotImplemented
#337
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
|
My preference would be to go with |
|
I do rather overload Downside is it would make it possible to add primal + Compromise could be to only all + to be propagating between NotImplented and AbstractDifferential types. I suspect we also should overload getproperty on NotImplented to return NotImplented. |
I tried this first but unfortunately it is not sufficient. The newly introduced tests in JuliaDiff/ChainRulesTestUtils.jl#140 still fail: the |
|
Hmm let's get some more opinions. Should we make + with NotImplented fully propagating the NotImplented (and never erroring). Or do we just allow that for "fields" of a Composite (this PR). |
|
I am unlikely to have time to really dig into this PR, and I have not been tracking the recent changes to |
|
I don't have any particular objection to implementing |
…mplemented`" This reverts commit 8d4f403.
Composites with fields of type NotImplementedNotImplemented
|
I updated the PR and enabled |
mzgubic
left a comment
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.
Thanks for fixing this, looks good to me.
| CFoo = Composite{Foo} | ||
| a = CFoo(x=1.5) | ||
| b = CFoo(x=@not_implemented("")) | ||
| for (x, y) in ((a, b), (b, a), (b, b)) |
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.
We probably don't need to test exhaustively? IMO we could just test Composite{Foo} with (a, b), (b, a) here.
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.
(b, b) tests +(::NotImplemented, ::NotImplemented) but, as the other two cases, in principle this is covered by the NotImplemented tests now as well. I kept the tests of the original PR since this was the actual problem that caused errors in ChainRulesTestUtils. Would you like me to remove the Composite tests?
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.
That would be my preference, but it is not strong and I leave it up to you to make a decision. Feel free to merge as is!
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.
If it's not necessary to remove the tests, I would like to keep them since they check the actual problem that this PR tries to solve. I assume that this is an advantage if, e.g., at some point a more restrictive policy regarding summation of NotImplemented is adopted.
This PR fixes the test failures in JuliaDiff/ChainRulesTestUtils.jl#140.
Alternatively, one couldThis PR allows+(::NotImplemented, y)(and permutations) more generally.