How to separate pytorch MNIST dataset into n subsets containing 2 classes each?

Double post from here.
Did you try to debug your code and check where the wrong entries come from?