tfp.substrates.numpy.random.split_seed
Stay organized with collections
Save and categorize content based on your preferences.
Splits a seed into n
derived seeds.
tfp.substrates.numpy.random.split_seed(
seed, n=2, salt=None, name=None
)
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 a
Tensor
. int
seeds are converted to Tensor
seeds using
tf.random.stateless_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. If
n 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 the
tf.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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-11-21 UTC."],[],[]]