Shortcuts

ListStorage

class torchrl.data.replay_buffers.ListStorage(max_size: Optional[int] = None, compilable: bool = False)[source]

A storage stored in a list.

This class cannot be extended with PyTrees, the data provided during calls to extend() should be iterables (like lists, tuples, tensors or tensordicts with non-empty batch-size).

Parameters:

max_size (int, optional) – the maximum number of elements stored in the storage. If not provided, an unlimited storage is created.

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

Parameters:

buffer – the object that reads from this storage.

dump(*args, **kwargs)

Alias for dumps().

load(*args, **kwargs)

Alias for loads().

save(*args, **kwargs)

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