Add multinomial op (#954)
Add multinomial op to onnx parser with ref and GPU implementations.
The onnx parser inserts a literal of shape {batch_size, sample_size} with random values in the range [0, 1) and inserts existing ops to compute the cumulative density function. The multinomial operator multiplies the random values by the sum of the CDF and returns the index of the first element of the CDF that is greater than the result, representing samples randomly drawn from [0, class_size) that follow the log-probability distribution.
Resolves #821
Co-authored-by:
Shucai Xiao <shucai@gmail.com>
Showing
File added
File added
File added
Please register or sign in to comment