pytorch/torch/utils
Ramil Nugmanov a2e81a8004 [DataLoader] __getitems__ added to description of Dataset API and better supported within Subset (#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: https://github.com/pytorch/pytorch/pull/100375
Approved by: https://github.com/ejguan, https://github.com/NivekT
2023-05-05 15:52:28 +00:00
..
_sympy Fix a number of issues with divs in ValueRangeAnalysis (#100547) 2023-05-04 12:31:55 +00:00
backcompat
benchmark torch.compile benchmark utility (#97699) 2023-04-12 03:02:06 +00:00
bottleneck
data [DataLoader] __getitems__ added to description of Dataset API and better supported within Subset (#100375) 2023-05-05 15:52:28 +00:00
hipify [BE] Fix SIM109 compare-with-tuple (#100337) 2023-04-30 19:51:32 +00:00
jit
model_dump [BE]: Merge startswith calls - rule PIE810 (#96754) 2023-03-14 22:05:20 +00:00
tensorboard
__init__.py Automatically generate attributes and methods for custom backends. (#98066) 2023-04-13 22:04:05 +00:00
_content_store.py Add load_storage (#100519) 2023-05-05 05:25:03 +00:00
_contextlib.py
_cpp_extension_versioner.py
_crash_handler.py
_cuda_trace.py Don't use f-strings in logging calls (1/X) (#98591) 2023-04-07 15:52:50 +00:00
_device.py Guard on default device (#99551) 2023-04-20 17:02:59 +00:00
_foreach_utils.py [BE] Enable C419 rule for any all shortcircuiting (#99890) 2023-04-25 15:02:13 +00:00
_freeze.py [BE] Enable C419 rule for any all shortcircuiting (#99890) 2023-04-25 15:02:13 +00:00
_mode_utils.py
_python_dispatch.py fix per-dispatchkey-mode caching bug (#98030) 2023-04-25 21:58:14 +00:00
_pytree.py Improve code to make it more pythonic. (#99720) 2023-04-23 16:42:13 +00:00
_stats.py
_traceback.py
_zip.py
backend_registration.py Fix a minor bug about method generation. (#99704) 2023-04-24 22:18:18 +00:00
bundled_inputs.py
checkpoint.py add checkpoint support for custom device (#99626) 2023-05-04 00:23:42 +00:00
collect_env.py [BE] Fix collect_env for python-path-with-space (#98415) 2023-04-06 01:09:23 +00:00
cpp_backtrace.py
cpp_extension.py Use correct standard when compiling NVCC on Windows (#100031) 2023-05-01 16:28:23 +00:00
dlpack.py Add DLPack support for XPU backend by mapping to kDLOneAPI in DLPack … (#94968) 2023-03-30 04:32:15 +00:00
file_baton.py Fix typos under torch/utils directory (#97516) 2023-03-24 16:53:39 +00:00
flop_counter.py tweak heuristic for sdpa selection based off of *data* (and a decision tree) (#99644) 2023-04-21 23:28:44 +00:00
hooks.py Fix module backward pre-hooks to actually update gradient (#97983) 2023-03-30 20:33:44 +00:00
mkldnn.py
mobile_optimizer.py [BE] Enable C419 rule for any all shortcircuiting (#99890) 2023-04-25 15:02:13 +00:00
model_zoo.py
show_pickle.py
throughput_benchmark.py
weak.py cudagraph trees (#89146) 2023-03-17 02:47:03 +00:00