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
.
Public Methods
Output<Object> |
asOutput()
Returns the symbolic handle of a tensor.
|
static SamplingDataset | |
Output<?> |
handle()
|
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 SamplingDataset create (Scope scope, Operand<?> inputDataset, Operand<Float> rate, Operand<Long> seed, Operand<Long> seed2, List<Class<?>> 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