def test_dynamic_init(self):
     sampler = WeightedSampler(reader=get_dynamic_window_reader(),
                               window_sizes=DYNAMIC_MOD_DATA,
                               batch_size=2,
                               windows_per_image=10,
                               queue_length=10)
     with self.cached_session() as sess:
         sampler.set_num_threads(2)
         out = sess.run(sampler.pop_batch_op())
         self.assertAllClose(out['image'].shape[1:], (8, 2, 256, 2))
 def test_2d_init(self):
     sampler = WeightedSampler(reader=get_2d_reader(),
                               window_sizes=MOD_2D_DATA,
                               batch_size=2,
                               windows_per_image=10,
                               queue_length=10)
     with self.cached_session() as sess:
         sampler.set_num_threads(2)
         out = sess.run(sampler.pop_batch_op())
         self.assertAllClose(out['image'].shape, (2, 10, 9, 1))
     sampler.close_all()