It may depend on the version of pytorch you use, in the latest one (1.0.0), WeightedRandomSampler has not a batch size argument anymore: https://pytorch.org/docs/stable/_modules/torch/utils/data/sampler.html 29
But yes I agree that the interface is a bit confusing !