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

Add support for mutating transformations #5

Open
oschulz opened this issue Nov 17, 2021 · 0 comments
Open

Add support for mutating transformations #5

oschulz opened this issue Nov 17, 2021 · 0 comments

Comments

@oschulz
Copy link
Collaborator

oschulz commented Nov 17, 2021

At some point we will probably want to add support for mutating transformation.

Mutating transformations are likely to become more relevant in the future. Non-mutating transformations are more prevalent at the moment, I think at least partially due to the limitations of AD-frameworks like Zygote. But with Enzyme we now have a reverse-mode AD solution for mutating functions, and AFAIK there are plans to support rules for mutating functions in ChainRulesCore.

The cleanest way to support this would probably be to add with_logabsdet_jacobian!, so that

(y, ladj) = with_logabsdet_jacobian!(f!, y, x)

We could provide automatic support for bc_f! = Base.Fix1(broadcast!, f!) as well (we already support Base.Fix1(broadcast, f), after all).

This issue is intended to collect comments and ideas, we can act on it once a concrete need (use case) arises.

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

1 participant