Solved by ptrblck in post #13 
              
              
                Thanks for the info. I’ll try to debug your code. 
In the meanwhile could you remove the recursion in __getitem__: 
return self.__getitem__(np.random.randint(0, self.__len__()))

and just return random data instead: 
return torch.randn(YOUR_SIZE), torch.randn(YOUR_SIZE)