torch.utils.data.DataLoader returns torch.tensors. Is there a way to return numpy arrays instead? The subclass coded below returns still tensors. I would like to change __iter()__
to return numpy arrays. (...my_tensor.numpy(),...) Just cannot figure it out.
class CustomDataLoader(DataLoader):
def __init__(self, dataset):
super().__init__(dataset)
def __iter__(self):
it_ = super().__iter__()
print( next(it_))
print(super().__iter__().__dict__)
return it_
c = CustomDataLoader(dataset)
next(iter(c))