You can do this
probs = torch.Tensor([ [0.1, 0.2, 0.7], [0.1, 0.8, 0.1], [0.4, 0.5, 0.1] ])
prob_dist = torch.distributions.Categorical(probs) # probs should be of size batch x classes
prob_dist.sample()

Also it torch.distributions.Categorical normalizes each row internally so you don’t need to do it.