-
Notifications
You must be signed in to change notification settings - Fork 62
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
make @non_differentiable
use identical pullbacks when possible
#679
make @non_differentiable
use identical pullbacks when possible
#679
Conversation
The test failures are integration tests, with ChainRulesOverloadGeneration.jl and Diffractor.jl. The ChainRulesOverloadGeneration.jl test failures seem unrelated, while Diffractor.jl has lots of opaque closure-related failures, but these fail independently of this PR. So I think this is good for review. |
The change is now improved and the diff much smaller. |
src/rule_definition_tools.jl
Outdated
function $(esc(propagator_name(primal_name, :pullback)))(@nospecialize(_)) | ||
return $(tup_expr) | ||
end | ||
NonDiffPullback($(tup_expr)) |
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.
I guess even simpler would be
NonDiffPullback($(tup_expr)) | |
Returns($(tup_expr)) |
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 will change the method signature, though. Currently the pullback accepts a single argument, while Returns
accepts any amount of arguments. Is that OK to change?
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.
Looks good to me, I think this is the simplest approach 🙂
Can you update the version number?
Fixes #678