LambdaMap

class tfdatacompose.lambdamap.lambdamap.LambdaMap(map: Callable[[...], Tensor | Tuple[Tensor, ...]])

Class for inline mapping operations.

Wraps the Tensorflow Map operation on the dataset. For short operations, this class can be used to avoid subclassing Map. Transformations should be implemented in the map constructor parameter.

Parameters:

map – lambda function implementing the transformation.

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