tf.compat.v1.random.stateless_multinomial

View source on GitHub

Draws deterministic pseudorandom samples from a multinomial distribution. (deprecated)

tf.compat.v1.random.stateless_multinomial(
    logits, num_samples, seed, output_dtype=tf.dtypes.int64, name=None
)

Warning: THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use tf.random.stateless_categorical instead.

This is a stateless version of tf.random.categorical: if run twice with the same seeds, it will produce the same pseudorandom numbers. The output is consistent across multiple runs on the same hardware (and between CPU and GPU), but may change between versions of TensorFlow or on non-CPU/GPU hardware.

Example:

# samples has shape [1, 5], where each value is either 0 or 1 with equal
# probability.
samples = tf.random.stateless_categorical(
    tf.math.log([[0.5, 0.5]]), 5, seed=[7, 17])

Args:

Returns:

The drawn samples of shape [batch_size, num_samples].