Batch

class tfdatacompose.batch.Batch(batch_size: int, drop_remainder: bool)

Dataset batching operation.

Wraps the Tensorflow Batch operation on the dataset. Makes batches of size batch_size from the dataset.

Parameters:
  • batch_size – the size of the batch

  • drop_remainder – drop the last elements if there’s not enough to make a batch

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