Class ov::op::v13::Multinomial#

class Multinomial : public ov::op::Op#

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

Public Functions

Multinomial(const Output<Node> &input, const Output<Node> &num_samples, const ov::element::Type_t convert_type, const bool with_replacement, const bool log_probs, const uint64_t global_seed = 0, const uint64_t op_seed = 0)#

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

Parameters:
  • probsInput tensor containing at each index poisition probability/log probability of sampling a given class. Any floating-point precision values are allowed.

  • num_samples – Scalar or 1D tensor with a single value that determines the number of samples to generate per batch. Values should be of an integer type.

  • convert_type – Data type to which to convert the output class indices. Allowed values: i32/i64

  • 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)

virtual void validate_and_infer_types() override#

Verifies that attributes and inputs are consistent and computes output shapes and element types. Must be implemented by concrete child classes so that it can be run any number of times.

Throws if the node is invalid.