tf_quant_finance.math.random.stateless_random_shuffle

Contents

Last updated: 2023-03-16.

tf_quant_finance.math.random.stateless_random_shuffle#

View source

Produces stateless random shuffle of the 1st dimension of an input Tensor.

tf_quant_finance.math.random.stateless_random_shuffle(
    input_tensor, seed, name=None
)

This is a stateless version of tf.random_shuffle. If run twice with the same seed, produces the same result.

Example

identity_shuffle = tf.range(100)
random_shuffle = stateless_random_shuffle(identity_shuffle, seed=(42, 2))

Args:#

  • input_tensor: float32, float64, int32 or int64 1-D Tensor.

  • seed: int32 or int64 Tensor of shape [2].

  • name: Python str name prefixed to ops created by this function.

Returns:#

A Tensor of the same shape and dtype as input_tensor.