Skip to content

prob fails with multiple chains #138

@awellis

Description

@awellis

I'm not sure whether this is by design, but the prob and logprob macros don't work when sampling with more than one chain:

using Distributions, Turing

@model demo(x) = begin
    m ~ Normal()
    for i ∈ eachindex(x)
      x[i] ~ Normal(m, 1)
    end
end

x = rand(Normal(3, 1), 10)

chn = sample(demo(x), NUTS(), MCMCThreads(), 2000, 2, save_state = true)
logprob"x = 1 | chain = chn"

produces an error

ERROR: DimensionMismatch("tried to assign 2 elements to 1 destinations")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions