def test_numpy_slices_num_samplers():
    logger.info('Test num_samplers.')
    np_data = [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10], [11, 12], [13, 14], [15, 16]]
    ds = de.NumpySlicesDataset(np_data, shuffle=False, num_samples=2)
    for (i, data) in enumerate(ds):
        assert np.equal(data[0], np_data[i]).all()
    assert (sum([1 for _ in ds]) == 2)
def test_numpy_slices_num_samplers():
    logger.info('Test num_samplers.')
    np_data = [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10], [11, 12], [13, 14], [15, 16]]
    ds = de.NumpySlicesDataset(np_data, shuffle=False, num_samples=2)
    for (i, data) in enumerate(ds):
        assert np.equal(data[0], np_data[i]).all()
    assert (sum([1 for _ in ds]) == 2)