File size: 198 Bytes
ec9a6bc
 
 
 
 
 
 
1
2
3
4
5
6
7
import torch
from prefetch_generator import BackgroundGenerator

class DataLoaderX(torch.utils.data.DataLoader):

    def __iter__(self):
        return BackgroundGenerator(super().__iter__())