Map

class tfdatacompose.map.map.Map

Base class for mapping operations.

Wraps the Tensorflow Map operation on the dataset. Transformations should be implemented in the map method.

apply(dataset: DatasetV1) DatasetV1

Applies the operation on the given dataset and returns the new dataset.

Parameters:

datasetTensorflow Dataset The dataset to change

Returns:

Tensorflow Dataset The changed dataset

abstract map(*args: Tensor) Tuple[Tensor, ...]

Implement your transformation in this method. The method receives an element of the dataset as input and should return the transformed elements. 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:

the transformed element.