API symbolsutils
Copy
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
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?
