Skip to contents

Shuffle the elements of a tensor uniformly at random along an axis.

Usage

random_shuffle(x, axis = 1L, seed = NULL)

Arguments

x

The tensor to be shuffled.

axis

An integer specifying the axis along which to shuffle. Defaults to 0.

seed

An R integer or instance of random_seed_generator(). Used to make the behavior of the initializer deterministic. Note that an initializer seeded with an integer or NULL (unseeded) will produce the same random values across multiple calls. To get different random values across multiple calls, use as seed an instance of random_seed_generator().

Value

A tensor, a copy of x with the axis axis shuffled.