Skip to content

Commit 33c54dc

Browse files
authored
Changed to more flexible type signature
You couldn't call `HeterogeneousMixture` on a vector of type `Vector{D}`, where `D` inherited from `Distributions{T}`. This should fix it.
1 parent cec0486 commit 33c54dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/modeling_library/mixture.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ Gen.is_discrete(dist::HeterogeneousMixture) = dist.is_discrete
178178

179179
const MIXTURE_WRONG_NUM_COMPONENTS_ERR = "the length of the weights vector does not match the number of mixture components"
180180

181-
function HeterogeneousMixture(distributions::Vector{Distribution{T}}) where {T}
181+
function HeterogeneousMixture(distributions::Vector{D}) where {T, D <: Distribution{T}}
182182
_has_output_grad = true
183183
_has_argument_grads = Bool[true] # weights
184184
_is_discrete = true

0 commit comments

Comments
 (0)