Streaming sample test
@@ -52,3 +52,10 @@ def test_down_sample_interval(net):
expected_num_samples = draws / down_sample_interval
assert all(len(vertex_samples) == expected_num_samples for vertex_id, vertex_samples in samples.items())
+
+
+def test_streaming_samples(net):
+ draws = 10
+ samples_stream = kn.samples_iter(net=net, sample_from=net.get_latent_vertices(), draws=draws, down_sample_interval=1)
+ assert sum(1 for i in samples_stream) == 10
+
