multinomial

dragon.random.multinomial(
  inputs,
  sample_size=1,
  **kwargs
)[source]

Return an index tensor sampled from the multinomial distribution.

Examples:

input = dragon.math.log(dragon.constant([0.5, 0.5]))
index = dragon.random.multinomial(input)
Parameters:
  • inputs (dragon.Tensor) – The input tensor.
  • sample_size (int, optional, default=1) – The number of samples.
Returns:

dragon.Tensor – The output tensor.