multinomial

dragon.vm.torch.multinomial(
  input,
  num_samples,
  out=None
)[source]

Return an index tensor sampled from the multinomial distribution.

Examples:

input = torch.tensor([0.5, 0.5]).log()
index = torch.multinomial(input, 1)
Parameters:
Returns:

dragon.vm.torch.Tensor – The output tensor.