Beispiel #1
0
def load_samples(loader,cuda,batch_size):
    sample_array = [next(loader) for i in range(0,batch_size)]
    batched_data, batched_targets = Batcher.batch_samples(sample_array)
    if cuda:
        batched_data = [x.cuda() for x in batched_data]
        batched_targets = [x.cuda() for x in batched_targets]
    return batched_data,batched_targets,sample_array
Beispiel #2
0
def load_samples(loader, cuda, batch_size):
    sample_array = [loader.next() for i in range(0, batch_size)]
    batched_data, batched_targets = Batcher.batch_samples(sample_array)
    if cuda:
        batched_data = map(lambda x: x.cuda(), batched_data)
        batched_targets = map(lambda x: x.cuda(), batched_targets)
    return batched_data, batched_targets, sample_array