tf.random_shuffle(value, seed=None, name=None)
See the guide: Constants, Sequences, and Random Values > Random Tensors
Randomly shuffles a tensor along its first dimension.
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]]
value
: A Tensor to be shuffled.seed
: A Python integer. Used to create a random seed for the distribution. See tf.set_random_seed
for behavior.name
: A name for the operation (optional).A tensor of same shape and type as value
, shuffled along its first dimension.
Defined in tensorflow/python/ops/random_ops.py
.
© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/random_shuffle