These numbers would represent a ~0.6% error, wouldn’t they?
Do you need an exact amount of class samples during your sampling?
If so, I think writing a custom sampler with a specified expected class count might be the better approach.
Yes you are right. I guess in case one want to generate a uniform distribution over imbalanced classes with low number of samples the WeightedRandomSampler might not be the best solution (as for num_samples=100 we have a deviation of up to 5 %).