File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -332,12 +332,11 @@ are compatible with Windows while using multi-process data loading:
332332Randomness in multi-process data loading
333333""""""""""""""""""""""""""""""""""""""""""
334334
335- By default, each worker will have its PyTorch seed set to
336- ``base_seed + worker_id ``, where ``base_seed `` is a long generated
337- by main process using its RNG. However, seeds for other libraries
338- may be duplicated upon initializing workers (w.g., NumPy), causing
339- each worker to return identical random numbers. (See
340- :ref: `this section <dataloader-workers-random-seed >` in FAQ.)
335+ By default, each worker will have its PyTorch seed set to ``base_seed + worker_id ``,
336+ where ``base_seed `` is a long generated by main process using its RNG (thereby,
337+ consuming a RNG state mandatorily). However, seeds for other libraries may be
338+ duplicated upon initializing workers (w.g., NumPy), causing each worker to return
339+ identical random numbers. (See :ref: `this section <dataloader-workers-random-seed >` in FAQ.).
341340
342341In :attr: `worker_init_fn `, you may access the PyTorch seed set for each worker
343342with either :func: `torch.utils.data.get_worker_info().seed <torch.utils.data.get_worker_info> `
Original file line number Diff line number Diff line change 2323# aspect.
2424default_collate = _utils .collate .default_collate
2525
26+
2627class _DatasetKind (object ):
2728 Map = 0
2829 Iterable = 1
@@ -39,6 +40,7 @@ class _InfiniteConstantSampler(Sampler):
3940 r"""Analogous to ``itertools.repeat(None, None)``.
4041 Used as sampler for :class:`~torch.utils.data.IterableDataset`.
4142 """
43+
4244 def __init__ (self ):
4345 super (_InfiniteConstantSampler , self ).__init__ (None )
4446
You can’t perform that action at this time.
0 commit comments