fast_tensor_dataset

A special type of tensor data set for improved performance.

class FastTensorDataset(*args: Any, **kwargs: Any)[source]

Bases: Dataset

A special type of tensor data set for improved performance.

This version of TensorDataset gathers data using a single call within __getitem__. A bit more tricky to manage but is faster still.

Parameters:
  • batch_size (int) – Batch size to be used with this data set.

  • tensors (object) – Torch tensors for this data set.

batch_size

Batch size to be used with this data set.

Type:

int

shuffle()[source]

Shuffle the data set.