RandomDatasetV2

public final class RandomDatasetV2

Creates a Dataset that returns pseudorandom numbers.

Creates a Dataset that returns a stream of uniformly distributed pseudorandom 64-bit signed integers. It accepts a boolean attribute that determines if the random number generators are re-applied at each epoch. The default value is True which means that the seeds are applied and the same sequence of random numbers are generated at each epoch. If set to False, the seeds are not re-applied and a different sequence of random numbers are generated at each epoch.

In the TensorFlow Python API, you can instantiate this dataset via the class `tf.data.experimental.RandomDatasetV2`.

Nested Classes

class RandomDatasetV2.Options Optional attributes for RandomDatasetV2  

Public Methods

Output<Object>
asOutput()
Returns the symbolic handle of a tensor.
static RandomDatasetV2
create(Scope scope, Operand<Long> seed, Operand<Long> seed2, Operand<?> seedGenerator, List<Class<?>> outputTypes, List<Shape> outputShapes, Options... options)
Factory method to create a class wrapping a new RandomDatasetV2 operation.
Output<?>
handle()
static RandomDatasetV2.Options
metadata(String metadata)
static RandomDatasetV2.Options
rerandomizeEachIteration(Boolean rerandomizeEachIteration)

Inherited Methods

Public Methods

public Output<Object> asOutput ()

Returns the symbolic handle of a tensor.

Inputs to TensorFlow operations are outputs of another TensorFlow operation. This method is used to obtain a symbolic handle that represents the computation of the input.

public static RandomDatasetV2 create (Scope scope, Operand<Long> seed, Operand<Long> seed2, Operand<?> seedGenerator, List<Class<?>> outputTypes, List<Shape> outputShapes, Options... options)

Factory method to create a class wrapping a new RandomDatasetV2 operation.

Parameters
scope current scope
seed A scalar seed for the random number generator. If either seed or seed2 is set to be non-zero, the random number generator is seeded by the given seed. Otherwise, a random seed is used.
seed2 A second scalar seed to avoid seed collision.
seedGenerator A resource for the random number seed generator.
options carries optional attributes values
Returns
  • a new instance of RandomDatasetV2

public Output<?> handle ()

public static RandomDatasetV2.Options metadata (String metadata)

public static RandomDatasetV2.Options rerandomizeEachIteration (Boolean rerandomizeEachIteration)

Parameters
rerandomizeEachIteration A boolean attribute to rerandomize the sequence of random numbers generated at each epoch.