Skip to content
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

Higher-Order functions: Low-hanging fruit #222

Closed
willtebbutt opened this issue Jul 1, 2020 · 4 comments
Closed

Higher-Order functions: Low-hanging fruit #222

willtebbutt opened this issue Jul 1, 2020 · 4 comments

Comments

@willtebbutt
Copy link
Member

We've yet to properly figure out how to make ChainRules play nicely with higher-order functions, see JuliaDiff/ChainRulesCore.jl#68.

However, this doesn't stop us from implement a load of rules for functions that ChainRules knows how to handle explicitly. For example, we have a rule for sin, so we can implement map(sin, x) ourselves for carefully chosen types of x.

A pre-requisite for this is JuliaDiff/ChainRulesCore.jl#127 which would let us get hold of all of the rules that we've implemented. It'll be necessary to be able to filter them for appropriateness so that we know what they're applicable to, in particular we need to know

  • the arity of the function to which the rule applies
  • the element types to which it applies

This would be a big win for e.g. Zygote where this is done, but with a piece-meal approach.

@oxinabox
Copy link
Member

do we need to know the return type also?

@willtebbutt
Copy link
Member Author

I don't think so 🤷 . Is this a particular concern?

@oxinabox
Copy link
Member

we don't know return types.
But if we don't need to, it is easy

@mzgubic
Copy link
Member

mzgubic commented Jun 22, 2021

We can probably close this now since JuliaDiff/ChainRulesCore.jl#363 is merged?

@mzgubic mzgubic closed this as completed Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants