Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DataLoader]
__getitems__
added to description of Dataset API and b…
…etter supported within `Subset` (pytorch#100375) DataLoader supports batched loading from Mapped Datasets. This is the fetcher's implementation of auto-detection of batch loading support. torch.utils.data._utils.fetch._MapDatasetFetcher ``` class _MapDatasetFetcher(_BaseDatasetFetcher): def fetch(self, possibly_batched_index): if self.auto_collation: if hasattr(self.dataset, "__getitems__") and self.dataset.__getitems__: data = self.dataset.__getitems__(possibly_batched_index) else: data = [self.dataset[idx] for idx in possibly_batched_index] ``` Description of Dataset API now shows this feature. Additionally, Subset dataset now supports `__getitems__` if parent dataset supports it. Pull Request resolved: pytorch#100375 Approved by: https://github.com/ejguan, https://github.com/NivekT
- Loading branch information