-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
deepcopy of Modules not supported #47
Comments
Definitely a compiler bug. If you can paste an MRP that'd be very helpful, if not a project/manifest with a reproducer script would be great. |
Repo with manifest: |
Or a standalone script: using Pkg
pkg"add LogDensityProblems#tp/zygote"
pkg"add Zygote#master IRTools#master"
pkg"add TransformVariables"
using LogDensityProblems, TransformVariables
import Zygote
f(x) = -3*abs2(x[1])
ℓ = TransformedLogDensity(as(Array, asℝ, 1), f)
∇ℓ = ADgradient(:Zygote, ℓ)
x = randn(1)
logdensity(LogDensityProblems.ValueGradient, ∇ℓ, x) |
I updated the repo, the issue still persists. |
Bump, I still have the issue, updated the repo above. |
#87 fixes your immediate issue but unfortunately isn't enough to get this example to run. The issue is this function since we don't support try/catch blocks yet (#88). If you refactor that to use return values it'll likely be both faster and more ADable in one go. |
Thanks for the fix and the advice. |
I am trying to add support for AD via Zygote for LogDensityProblems in this PR: tpapp/LogDensityProblems.jl#24, but this line (currently skipped) fails with
I realize the example is far from minimal, but if I am doing something obviously wrong, I would appreciate advice about it.
The text was updated successfully, but these errors were encountered: