Solved by ptrblck in post #2 
              
              
                The WeightedRandomSampler expects a weight tensor, which assigns a weight to each sample, not the class labels. 
Here is an example of its usage. 
Based on your description it also seems that you are working on a multi-label classification, where each sample might belong to zero, one, or more classe…