rfeinman:

if self.shuffle:
            self.skf.random_state = torch.randint(0,int(1e8),size=()).item()



Looks a good solution! Why providing the seed here instead at creation time?
I think there is a little correction to do though:



 rfeinman:

return len(self.y)


__len__ should return len(self.y) // batch_size no?