Shortcuts

Storage

class torchrl.data.replay_buffers.Storage(max_size: int, checkpointer: Optional[StorageCheckpointerBase] = None)[source]

A Storage is the container of a replay buffer.

Every storage must have a set, get and __len__ methods implemented. Get and set should support integers as well as list of integers.

The storage does not need to have a definite size, but if it does one should make sure that it is compatible with the buffer size.

attach(buffer: Any) None[source]

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).

Parameters:

buffer – the object that reads from this storage.

dump(*args, **kwargs)[source]

Alias for dumps().

load(*args, **kwargs)[source]

Alias for loads().

save(*args, **kwargs)[source]

Alias for dumps().

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources