SamplingDataset

public final class SamplingDataset

Creates a dataset that takes a Bernoulli sample of the contents of another dataset.

There is no transformation in the tf.data Python API for creating this dataset. Instead, it is created as a result of the `filter_with_random_uniform_fusion` static optimization. Whether this optimization is performed is determined by the `experimental_optimization.filter_with_random_uniform_fusion` option of tf.data.Options.

Constants

String OP_NAME The name of this op, as known by TensorFlow core engine

Public Methods

Output<TType>
asOutput()
Returns the symbolic handle of the tensor.
static SamplingDataset
create(Scope scope, Operand<?> inputDataset, Operand<TFloat32> rate, Operand<TInt64> seed, Operand<TInt64> seed2, List<Class<? extends TType>> outputTypes, List<Shape> outputShapes)
Factory method to create a class wrapping a new SamplingDataset operation.
Output<?>
handle()

Inherited Methods

Constants

public static final String OP_NAME

The name of this op, as known by TensorFlow core engine

Constant Value: "SamplingDataset"

Public Methods

public Output<TType> asOutput ()

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.

public static SamplingDataset create (Scope scope, Operand<?> inputDataset, Operand<TFloat32> rate, Operand<TInt64> seed, Operand<TInt64> seed2, List<Class<? extends TType>> outputTypes, List<Shape> outputShapes)

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

Parameters
scope current scope
rate A scalar representing the sample rate. Each element of `input_dataset` is retained with this probability, independent of all other elements.
seed A scalar representing seed of random number generator.
seed2 A scalar representing seed2 of random number generator.
Returns
  • a new instance of SamplingDataset

public Output<?> handle ()