tf.random.shuffle
Stay organized with collections
Save and categorize content based on your preferences.
Randomly shuffles a tensor along its first dimension.
tf.random.shuffle(
value, seed=None, name=None
)
Used in the notebooks
Used in the guide |
Used in the tutorials |
|
|
The tensor is shuffled along dimension 0, such that each value[j]
is mapped
to one and only one output[i]
. For example, a mapping that might occur for a
3x2 tensor is:
[[1, 2], [[5, 6],
[3, 4], ==> [1, 2],
[5, 6]] [3, 4]]
Args |
value
|
A Tensor to be shuffled.
|
seed
|
A Python integer. Used to create a random seed for the distribution.
See
tf.random.set_seed
for behavior.
|
name
|
A name for the operation (optional).
|
Returns |
A tensor of same shape and type as value , shuffled along its first
dimension.
|
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. Some content is licensed under the numpy license.
Last updated 2024-04-26 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 2024-04-26 UTC."],[],[]]