TensorPlay
API symbolsutils
Copy
View MarkdownDownload .md

Subset

class tensorplay.utils.data.Subset(dataset: Dataset[_T_co], indices: Sequence[int])[source]

Subset of a dataset at specified indices.

Note

When subclassing Subset and overriding __getitem__, you must also override __getitems__ to ensure DataLoader works correctly with your custom logic. If you override only __getitem__, a NotImplementedError will be raised when using DataLoader.

Parameters:
  • dataset (Dataset) – The whole Dataset

  • indices (sequence) – Indices in the whole set selected for subset

Ask DeepWiki