Skip to content

Add support for mutating transformations #5

@oschulz

Description

@oschulz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions