-
Notifications
You must be signed in to change notification settings - Fork 37
Description
DynamicPPL.jl/src/pointwise_logdensities.jl
Lines 227 to 229 in 9bd8f16
| function pointwise_logdensities( | |
| model::Model, chain, ::Type{KeyType}=VarName, ::Val{whichlogprob}=Val(:both) | |
| ) where {KeyType,whichlogprob} |
Lines 1837 to 1839 in 9bd8f16
| function setval!(vi::VarInfo, chains::AbstractChains, sample_idx::Int, chain_idx::Int) | |
| return setval!(vi, chains.value[sample_idx, :, chain_idx], keys(chains)) | |
| end |
These functions claim to work either on chain::Any or chain::AbstractMCMC.AbstractChains. In practice the first one calls the second, so the first should only work on AbstractChains. However there is no guarantee that an AbstractChains type can be indexed into using chains.value[iter, :, chain]. This makes assumptions about the internal structure of chains which are only true of MCMCChains.Chains.
DynamicPPL.jl/src/pointwise_logdensities.jl
Lines 260 to 261 in 9bd8f16
| niters = size(chain, 1) | |
| nchains = size(chain, 3) |
There is also no guarantee that size(chain, 1) or size(chain, 3) return the number of iterations or chains respectively. Again this is only true for MCMCChains.
All these functions' signatures should be restricted to MCMCChains and moved to MCMCChainsExt