File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -813,4 +813,21 @@ DynamicPPL.getspace(::DynamicPPL.Sampler{MySAlg}) = (:s,)
813
813
@test DynamicPPL. istrans (varinfo2, vn)
814
814
end
815
815
end
816
+
817
+ @testset " getranges" begin
818
+ @testset " $(model. f) " for model in DynamicPPL. TestUtils. DEMO_MODELS
819
+ vns = DynamicPPL. TestUtils. varnames (model)
820
+ varinfo = DynamicPPL. typed_varinfo (model)
821
+ x = values_as (varinfo, Vector)
822
+
823
+ # Let's just check all the subsets of `vns`.
824
+ @testset " $(convert (Vector{Any},vns_subset)) " for vns_subset in combinations (vns)
825
+ ranges = DynamicPPL. getranges (varinfo, vns_subset)
826
+ @test length (ranges) == length (vns_subset)
827
+ for (r, vn) in zip (ranges, vns_subset)
828
+ @test x[r] == DynamicPPL. tovec (varinfo[vn])
829
+ end
830
+ end
831
+ end
832
+ end
816
833
end
You can’t perform that action at this time.
0 commit comments