- class torchrl.data.replay_buffers.LazyTensorStorage(*args, **kwargs)[source]¶
A pre-allocated tensor storage for tensors and tensordicts.
size (int) – size of the storage, i.e. maximum number of elements stored in the buffer.
device (torch.device, optional) – device where the sampled tensors will be stored and sent. Default is
- attach(buffer: Any) None ¶
This function attaches a sampler to this storage.
Buffers that read from this storage must be included as an attached entity by calling this method. This guarantees that when data in the storage changes, components are made aware of changes even if the storage is shared with other buffers (eg. Priority Samplers).
buffer – the object that reads from this storage.