@model function test_model(x, y, mx, vx)
for i in 1:3
x[i] ~ NormalMeanVariance(mx, vx)
end
my ~ NormalMeanVariance(0, 1)
y ~ NormalMeanVariance(my, 1.0)
end
d = [(x = rand(3),y = rand()) for i in 1:10]
datastream = from(d) |> map(NamedTuple{(:x, :y), Tuple{Vector{Float64}, Float64}}, (d) -> d)
foo(x) = 1.0
autoupdates = @autoupdates begin
mx = foo(q(my))
vx = foo(q(my))
end
If we add a vector/tensor of inputs in streaming inference and create a (data)variable for every entry, we get the following error message:
MWE:
The following code runs and gives a result:
When we run streaming inference the error message is being thrown:
The following fixes this, but might not be the most rigorous fix: