Sampler#
- class torchrl.data.replay_buffers.Sampler(*args, **kwargs)#
A generic sampler base class for composable Replay Buffers.
- Variables:
requires_shared_state (bool) –
Truewhen sampling mutates state that every consumer of the buffer must observe, such as without-replacement bookkeeping, priorities, consumption marks, staleness counters or streaming queues. Such a sampler cannot be copied intotorch.utils.data.DataLoaderworkers. Defaults toTrue; samplers whose draws depend only on the storage content and their configuration, such asRandomSamplerandSliceSampler, set it toFalse.