The passed weights are used in torch.multinomial as seen here 2, which is a random function, so you cannot expect a perfectly sampled distribution.
The sample count will approximate the expected number, the more samples you are drawing.