-
Notifications
You must be signed in to change notification settings - Fork 37
Closed as duplicate of#388
Closed as duplicate of#388
Copy link
Description
Following on from helpful chat in #929 I've found a bug in DPPL/Turing sampling from ProductNamedTupleDistribution around tovec being used down the stack.
Here is a reprex:
julia> using Distributions, Turing
julia> priors = (a = Normal(), b = Normal());
julia> priors_dist = product_distribution(priors)
# ProductNamedTupleDistribution{(:a, :b)}(
# a: Normal{Float64}(μ=0.0, σ=1.0)
# b: Normal{Float64}(μ=0.0, σ=1.0)
# )
julia> @model function sample_nt(priors_dist)
x ~ priors_dist
return x
end
# sample_nt (generic function with 2 methods)
julia> mdl = sample_nt(priors_dist);
julia> mdl()ERROR: MethodError: no method matching tovec(::@NamedTuple{a::Float64, b::Float64})
The functiontovecexists, but no method is defined for this combination of argument types.
Closest candidates are:
tovec(::LinearAlgebra.Cholesky)
@ DynamicPPL ~/.julia/packages/DynamicPPL/vlXDM/src/utils.jl:446
tovec(::AbstractArray)
@ DynamicPPL ~/.julia/packages/DynamicPPL/vlXDM/src/utils.jl:445
tovec(::Real)
@ DynamicPPL ~/.julia/packages/DynamicPPL/vlXDM/src/utils.jl:444
seabbs
Metadata
Metadata
Assignees
Labels
No labels