File tree Expand file tree Collapse file tree 1 file changed +0
-37
lines changed Expand file tree Collapse file tree 1 file changed +0
-37
lines changed Original file line number Diff line number Diff line change 959
959
@test merge (vi_double, vi_single)[vn] == 1.0
960
960
end
961
961
962
- @testset " sampling from linked varinfo" begin
963
- # `~`
964
- @model function demo (n= 1 )
965
- x = Vector (undef, n)
966
- for i in eachindex (x)
967
- x[i] ~ Exponential ()
968
- end
969
- return x
970
- end
971
- model1 = demo (1 )
972
- varinfo1 = DynamicPPL. link!! (VarInfo (model1), model1)
973
- # Calling init!! should preserve the fact that the variables are linked.
974
- model2 = demo (2 )
975
- varinfo2 = last (DynamicPPL. init!! (model2, deepcopy (varinfo1), InitFromPrior ()))
976
- for vn in [@varname (x[1 ]), @varname (x[2 ])]
977
- @test DynamicPPL. istrans (varinfo2, vn)
978
- end
979
-
980
- # `.~`
981
- @model function demo_dot (n= 1 )
982
- x ~ Exponential ()
983
- if n > 1
984
- y = Vector (undef, n - 1 )
985
- y .~ Exponential ()
986
- end
987
- return x
988
- end
989
- model1 = demo_dot (1 )
990
- varinfo1 = DynamicPPL. link!! (DynamicPPL. untyped_varinfo (model1), model1)
991
- # Calling init!! should preserve the fact that the variables are linked.
992
- model2 = demo_dot (2 )
993
- varinfo2 = last (DynamicPPL. init!! (model2, deepcopy (varinfo1), InitFromPrior ()))
994
- for vn in [@varname (x), @varname (y[1 ])]
995
- @test DynamicPPL. istrans (varinfo2, vn)
996
- end
997
- end
998
-
999
962
# NOTE: It is not yet clear if this is something we want from all varinfo types.
1000
963
# Hence, we only test the `VarInfo` types here.
1001
964
@testset " vector_getranges for `VarInfo`" begin
You can’t perform that action at this time.
0 commit comments