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

Multivariate Log Normal rand not compatible with Zygote #257

Open
weilandtd opened this issue Sep 8, 2023 · 0 comments
Open

Multivariate Log Normal rand not compatible with Zygote #257

weilandtd opened this issue Sep 8, 2023 · 0 comments

Comments

@weilandtd
Copy link

Implementation of Distributions.rand is not compatible with Zygote due to mutable operation:

function Distributions.rand(rng::Random.AbstractRNG, d::TuringMvLogNormal, n::Int)
x = rand(rng, d.normal, n)
map!(exp,x, x)
return x
end

This works with with Zygote. But I am not sure how to multiplex this for Zygote only:

function Distributions.rand(rng::Random.AbstractRNG, d::TuringMvLogNormal, n::Int)
x = rand(rng, d.normal, n)
xp = map(exp,x)
return xp
end

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