@@ -45,15 +45,15 @@ function Distributions._rand!(
45
45
@inbounds for (i, αi) in zip (eachindex (x), d. alpha)
46
46
x[i] = rand (rng, Gamma (αi))
47
47
end
48
- Distributions . multiply! (x, inv (sum (x))) # this returns x
48
+ lmul! ( inv (sum (x)), x ) # this returns x
49
49
end
50
50
function Distributions. _rand! (
51
51
rng:: AbstractRNG ,
52
52
d:: TuringDirichlet{<:Real,<:FillArrays.AbstractFill} ,
53
53
x:: AbstractVector{<:Real}
54
54
)
55
55
rand! (rng, Gamma (FillArrays. getindex_value (d. alpha)), x)
56
- Distributions . multiply! (x, inv (sum (x))) # this returns x
56
+ lmul! ( inv (sum (x)), x ) # this returns x
57
57
end
58
58
59
59
function Distributions. _logpdf (d:: TuringDirichlet , x:: AbstractVector{<:Real} )
@@ -246,10 +246,14 @@ MvLogNormal(d::TuringDiagMvNormal) = TuringMvLogNormal(d)
246
246
MvLogNormal (d:: TuringScalMvNormal ) = TuringMvLogNormal (d)
247
247
Distributions. length (d:: TuringMvLogNormal ) = length (d. normal)
248
248
function Distributions. rand (rng:: Random.AbstractRNG , d:: TuringMvLogNormal )
249
- return Distributions. exp! (rand (rng, d. normal))
249
+ x = rand (rng, d. normal)
250
+ map! (exp, x, x)
251
+ return x
250
252
end
251
253
function Distributions. rand (rng:: Random.AbstractRNG , d:: TuringMvLogNormal , n:: Int )
252
- return Distributions. exp! (rand (rng, d. normal, n))
254
+ x = rand (rng, d. normal, n)
255
+ map! (exp, x, x)
256
+ return x
253
257
end
254
258
255
259
function Distributions. _logpdf (d:: TuringMvLogNormal , x:: AbstractVector{T} ) where {T<: Real }
0 commit comments