Skip to content

Commit 0b4a035

Browse files
committed
update basemeasure
1 parent c5d5f2e commit 0b4a035

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/combinators/product.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export ProductMeasure
22

33
using MappedArrays
44
using Base: @propagate_inbounds
5+
using FillArrays
56

67
struct ProductMeasure{F,I} <: AbstractMeasure
78
f::F
@@ -14,6 +15,8 @@ Base.length(m::ProductMeasure{T}) where {T} = length(marginals(μ))
1415

1516
# TODO: Pull weights outside
1617
basemeasure(d::ProductMeasure) = ProductMeasure(basemeasure d.f, d.pars)
18+
basemeasure(d::ProductMeasure{typeof(identity)}) = ProductMeasure(identity, map(basemeasure, d.pars))
19+
basemeasure(d::ProductMeasure{typeof(identity), <:FillArrays.Fill}) = ProductMeasure(identity, map(basemeasure, d.pars))
1720

1821
export marginals
1922

@@ -197,4 +200,4 @@ end
197200
# sum(zip(marginals(μ), marginals(ν), x)) do μ_ν_x
198201
# logdensity(μ_ν_x...)
199202
# end
200-
# end
203+
# end

0 commit comments

Comments
 (0)