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

Practicalities of Incorporating Existing ChainRules #24

Closed
willtebbutt opened this issue Oct 19, 2023 · 3 comments
Closed

Practicalities of Incorporating Existing ChainRules #24

willtebbutt opened this issue Oct 19, 2023 · 3 comments

Comments

@willtebbutt
Copy link
Member

Incorporating a specific ChainRule that has already been written is entirely straightforward. Precisely how an entire library of ChainRules ought to be incorporated is another matter. For example, probably most of the ChainRules in SpecialFunctions.jl will work fine in this system (i.e. there won't be any type problems), but we really need to decide whether or not to incorporate them on a case-by-case basis.

One option is to create a package extension to this package which manually chooses which rules to incorporate. This might provide a decent hack, but obviously won't keep up to date with SpecialFunctions.jl.

@yebai
Copy link
Contributor

yebai commented Oct 19, 2023

It’s a sensible idea to begin with.

@willtebbutt
Copy link
Member Author

Note: we now have an actual example of doing this in practice here. It's done entirely manually, but it demonstrates the core point (that it's entirely straightforward to combine ChainRules.rrules with rrule!!s).

(This obviously isn't the end point of this line of work, but it does demonstrate a practical working example of this)

@willtebbutt
Copy link
Member Author

I'm closing this via #88 , which introduces a macro for defining rrule!!s using rrules.

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

No branches or pull requests

2 participants