I want to do something like this:
class myDataset():
    def __init__():
        self.iter = some_iterator_on_my_dataset
    def __len__():
        return len_of_my_dataset
    def __getitem__():
        return self.iter.next()

loader = DataLoader(myDataset, num_workers=16)

which works well when num_workers=1, failed when num_workers>1 however.
I guess that self.iter, the iterator failed in multi-process loader.
How shuold I do that?