Weighted Random Sampler pytorch

I am trying to understand the weightedrandomsampler in pytorch.
https://pytorch.org/docs/stable/data.html#torch.utils.data.WeightedRandomSampler
An example in the docs like as given for the BatchRandomSampler would have been great.
I know it is a simple question but can anyone give me a simple example with a dummy dataset?

2 Likes