Skip to content

Commit 8a6db2d

Browse files
committed
Merge branch 'mt/array_dist_and_multi' of https://github.com/TuringLang/DistributionsAD.jl into mt/array_dist_and_multi
2 parents 751e138 + 2b88f7b commit 8a6db2d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/multivariate.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function TuringDirichlet(alpha::AbstractVector{T}) where {T <: Integer}
3232
Tf = float(T)
3333
TuringDirichlet(convert(AbstractVector{Tf}, alpha))
3434
end
35-
TuringDirichlet(d::Integer, alpha::Integer) = TuringDirichlet(d, Float64(alpha))
35+
TuringDirichlet(d::Integer, alpha::Integer) = TuringDirichlet(d, float(alpha))
3636

3737
Distributions.Dirichlet(alpha::TrackedVector) = TuringDirichlet(alpha)
3838
Distributions.Dirichlet(d::Integer, alpha::TrackedReal) = TuringDirichlet(d, alpha)
@@ -119,7 +119,7 @@ end
119119
Distributions.params(d::TuringDiagMvNormal) = (d.m, d.σ)
120120
Distributions.dim(d::TuringDiagMvNormal) = length(d.m)
121121
Base.length(d::TuringDiagMvNormal) = length(d.m)
122-
Base.size(d::TuringDiagMvNormal) = (length(d), length(d))
122+
Base.size(d::TuringDiagMvNormal) = (length(d),)
123123
Distributions.rand(d::TuringDiagMvNormal, n::Int...) = rand(Random.GLOBAL_RNG, d, n...)
124124
function Distributions.rand(rng::Random.AbstractRNG, d::TuringDiagMvNormal, n::Int...)
125125
return d.m .+ d.σ .* randn(rng, length(d), n...)
@@ -131,7 +131,7 @@ struct TuringScalMvNormal{Tm<:AbstractVector, Tσ<:Real} <: ContinuousMultivaria
131131
end
132132

133133
Base.length(d::TuringScalMvNormal) = length(d.m)
134-
Base.size(d::TuringScalMvNormal) = (length(d), length(d))
134+
Base.size(d::TuringScalMvNormal) = (length(d),)
135135
Distributions.rand(d::TuringScalMvNormal, n::Int...) = rand(Random.GLOBAL_RNG, d, n...)
136136
function Distributions.rand(rng::Random.AbstractRNG, d::TuringScalMvNormal, n::Int...)
137137
return d.m .+ d.σ .* randn(rng, length(d), n...)

0 commit comments

Comments
 (0)