By default torch.multinomial will use replacement=False.
Since only two weights are positive in your example, you won’t be able to draw 4 samples with this setup.
Using torch.multinomial(weights, 4, replacement=True) will work on the other hand.
The returned tensor will give you the samples indices. In your code example you would sample index1 and index2.