namespace ov::reference::multinomial

Overview

namespace multinomial {

// construction

template <typename T, typename U, typename V>
multinomial(
    const T \* probs,
    const Shape& probs_shape,
    const U \* num_samples,
    const Shape& num_samples_shape,
    V \* output,
    const Shape& output_shape,
    const bool with_replacement,
    const bool log_probs,
    const uint64_t global_seed,
    const uint64_t op_seed
    );

} // namespace multinomial

Detailed Documentation

Construction

template <typename T, typename U, typename V>
multinomial(
    const T \* probs,
    const Shape& probs_shape,
    const U \* num_samples,
    const Shape& num_samples_shape,
    V \* output,
    const Shape& output_shape,
    const bool with_replacement,
    const bool log_probs,
    const uint64_t global_seed,
    const uint64_t op_seed
    )

Multinomial operation creates a sequence of indices of classes sampled from the multinomial distribution.

Parameters:

T

Data type of the probs’ values.

U

Data type of num_samples’ values.

V

Data type of output’s values.

probs

Input tensor containing at each index poisition probability/log probability of sampling a given class.

probs_shape

Shape of the ‘probs’ tensor.

num_samples

Scalar or 1D tensor with a single value that determines the number of samples to generate per batch.

num_samples_shape

Shape of the ‘num_samples’ tensor.

output

Output tensor for the generated class indices.

output_shape

Shape of the ‘output’ tensor.

with_replacement

Boolean that determines whether a sampled class can appear more than once in the output.

log_probs

Boolean that determines whether to treat input probabilities as log probabilities.

global_seed

First seed value (key) of Phillox random number generation algorithm. (See RandomUniform for details)

op_seed

Second seed value (counter) of Phillox random number generation algorithm. (See RandomUniform for details)