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

Support MutableTangent automatically #286

Open
oxinabox opened this issue Sep 18, 2023 · 0 comments
Open

Support MutableTangent automatically #286

oxinabox opened this issue Sep 18, 2023 · 0 comments
Labels

Comments

@oxinabox
Copy link
Member

This is a follow up to JuliaDiff/ChainRulesCore.jl#105 (comment)

Right now, using JuliaDiff/ChainRulesCore.jl#626 if you want to test something that MutableTangent that does work e.g.:
test_frule(setfield!, MDemo(3.5)⊢MutableTangent{MDemo}(x=2.0), :x, 5.0)

But if you just do:
test_frule(setfield!, MDemo(3.5), :x, 5.0)
you get an error because the default type we use for structural tangents is the immutable Tangent

We could use the StructuralTangent constructor to automatically chose MutableTangent for mutable primals.
we would want to do that forwardward mode, at least. Not sure if we should also do that in reverse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant