Solved by ptrblck in post #4 
              
              
                WeightedRandomSampler is used to provide weights to each sample, which is used during the sampling process of selecting the data samples for each batch. 
The higher the weight assigned to a particular index, the more likely this data sample will be used in a batch. 
To created batches of balanced cl…