Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)

src/p/y/pylearn2-HEAD/pylearn2/utils/tests/test_iteration.py   pylearn2(Download)
"""Tests for iterators."""
import numpy as np
from pylearn2.utils.iteration import (
    SubsetIterator,
    SequentialSubsetIterator,
def test_random_slice():
    iterator = RandomSliceSubsetIterator(50, num_batches=10, batch_size=5)
    num = 0
    for iter_slice in iterator:
        assert iter_slice.start >= 0