import torch
t = torch.rand(10) #create CPU tensor
t.multinomial(1) #returns a result, as expected
tn = -t
tn.multinomial(1) # throws an exception, as per the documentation
tn = tn.cuda()
tn.multinomial(1) # returns a value, don't know from what distribution
tn.multinomial(1000, True) # returns a tensor of 1000 zeros
Looking at the values returned from tn.multinomial(1) and counting them, it seems like it returns the values of the multinomial distribution taken from t, i.e. that it has ignored the signs of the values. However, it seem like tn.multinomial(n where n > 1) always returns a tensor filled with zeros.