Rate this Page
★ ★ ★ ★ ★

TensorDictBase.load#

classmethod TensorDictBase.load(prefix: str | Path, *args, **kwargs) → Self#

Loads a tensordict that save() or memmap() wrote to disk.

load is load_memmap(): it takes the same arguments, including allow_pickle, device and mode. The leaves of the result are memory-mapped tensors that read the files. See Save and load tensordicts and the example of save().

Parameters:

prefix (str or Path) – the directory, or the ".tdz" archive file, to read.

Every tensordict class and every tensorclass has this method. For the other methods, see Methods by task.