tfp.random.split_seed | TensorFlow Probability (original) (raw)
tfp.random.split_seed
Splits a seed into n
derived seeds.
tfp.random.split_seed(
seed, n=2, salt=None, name=None
)
Used in the notebooks
Used in the tutorials |
---|
TFP Release Notes notebook (0.12.1) TFP Release Notes notebook (0.13.0) |
See https://github.com/tensorflow/probability/blob/main/PRNGS.md for details. Args: seed: The seed to split; may be an int
, an (int, int) tuple
, or aTensor
. int
seeds are converted to Tensor
seeds usingtf.random.uniform stateful sampling. Tuples are converted to Tensor
. n: The number of splits to return. In TensorFlow, if n
is an integer, this function returns a list of seeds and otherwise returns a Tensor
of seeds. In JAX, this function always returns an array of seeds. salt: Optional str
salt to mix with the seed. name: Optional name to scope related ops.
Returns | |
---|---|
seeds | If n is a Python int, a tuple of seed values is returned. Ifn is an int Tensor, a single Tensor of shape [n, 2] is returned. A single such seed is suitable to pass as the seed argument of thetf.random.stateless_* ops. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-11-21 UTC.