Change default Metadata value type to Any#1003
Conversation
|
Probably not going to spend much time on this, but if anybody would like to take this further: the main failure in CI seems to be here calling I don't immediately know how to fix this though because in DynamicPPL we can't overwrite the method definition in ChangesOfVariables (short of changing it upstream). Of course we could also do the nuclear option of Not sure if we could have something like |
Nope, not that simple either, since there's more magic that ERROR: TypeError: in typeassert, expected DynamicPPL.DynamicPPLAny, got a value of type Float64
Stacktrace:
[1] push!(a::Vector{DynamicPPL.DynamicPPLAny}, item::Float64)
@ Base ./array.jl:1260 |
Currently,
Metadataassumes that all the values it can hold areReals. This seems unnecessarily restrictive. For example, if I wake up one day and decide that I would like to use MCMC sampling to decide which fruit I should eat for breakfast:then I should really be able to do it. Unfortunately, right now, I can't, because
Metadataexpects its values to be stored inside aVector{<:Real}, and aFruitisn't aReal.The main aim of this PR is to check what would happen on CI if we relaxed this bound to
Any. After all,Realis already abstract, so surely there isn't any type stability to be lost.With this PR, plus a bunch of overloads, we can actually evaluate these models:
I have not tested actual sampling with Turing.
Using #985 as the base just to reduce the number of different branching versions of the codebase I need to keep in mind.