Skip to content

Multivariate Log Normal rand not compatible with Zygote #257

@weilandtd

Description

@weilandtd

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

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