Class RandomDataset

java.lang.Object
org.tensorflow.op.RawOp
org.tensorflow.op.data.RandomDataset
All Implemented Interfaces:
Shaped, Op, Operand<TType>

@Operator(group="data") public final class RandomDataset extends RawOp implements Operand<TType>
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.

  • Field Details

  • Constructor Details

    • RandomDataset

      public RandomDataset(Operation operation)
  • Method Details

    • create

      @Endpoint(describeByClass=true) public static RandomDataset create(Scope scope, Operand<TInt64> seed, Operand<TInt64> seed2, Operand<? extends TType> seedGenerator, List<Class<? extends TType>> outputTypes, List<Shape> outputShapes, RandomDataset.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.
      outputTypes - The value of the outputTypes attribute
      outputShapes - The value of the outputShapes attribute
      options - carries optional attribute values
      Returns:
      a new instance of RandomDataset
    • rerandomizeEachIteration

      public static RandomDataset.Options rerandomizeEachIteration(Boolean rerandomizeEachIteration)
      Sets the rerandomizeEachIteration option.
      Parameters:
      rerandomizeEachIteration - A boolean attribute to rerandomize the sequence of random numbers generated at each epoch.
      Returns:
      this Options instance.
    • metadata

      public static RandomDataset.Options metadata(String metadata)
      Sets the metadata option.
      Parameters:
      metadata - the metadata option
      Returns:
      this Options instance.
    • handle

      public Output<? extends TType> handle()
      Gets handle.
      Returns:
      handle.
    • asOutput

      public Output<TType> asOutput()
      Description copied from interface: Operand
      Returns the symbolic handle of the 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.

      Specified by:
      asOutput in interface Operand<TType>
      See Also: