Ejemplo n.º 1
0
def test_multi_worker():
    data = Dataset()
    for thread_pool in [True, False]:
        loader = gluon.data.DataLoader(data,
                                       batch_size=1,
                                       num_workers=5,
                                       thread_pool=thread_pool)
        for i, batch in enumerate(loader):
            assert (batch.asnumpy() == i).all()
Ejemplo n.º 2
0
def test_multi_worker():
    data = Dataset()
    loader = gluon.data.DataLoader(data, batch_size=1, num_workers=5)
    for i, batch in enumerate(loader):
        assert (batch.asnumpy() == i).all()