FlatMap
- class tfdatacompose.flatmap.FlatMap
Base class for flat mapping opertaions.
Wraps the Tensorflow Flat Map operation on the dataset. Transformations should be implemented in the
flatmapmethod.- apply(dataset: DatasetV1) DatasetV1
Applies the operation on the given dataset and returns the new dataset.
- Parameters:
dataset – Tensorflow Dataset The dataset to change
- Returns:
Tensorflow Dataset The changed dataset
- abstract flatmap(*args: Tensor) DatasetV1
Implement your transformation in this method. The method receives element an element of the dataset as input and should return a new dataset. All new datasets returned by this method are flattened together. You can change the arguments of this method to retrieve the inner element of tuples if your dataset elements are tuples. Example:
map(self, x: int, y:int) -> int- Parameters:
args – the dataset element.
- Returns:
a new dataset