Solved by ptrblck in post #15 
              
              
                I think it will still work. If I’m not misunderstanding your concern, that should be exactly how the WeightedRandomSampler works. 
I’ve adapted an old example using two highly imbalanced classes: 
numDataPoints = 1000
data_dim = 5
bs = 100

# Create dummy data with class imbalance 99 to 1
data = tor…