TensorDictBase.make_memmap#
- TensorDictBase.make_memmap(key: NestedKey, shape: Size | Tensor, *, dtype: dtype | None = None, robust_key: bool | None = True) MemoryMappedTensor#
Creates an empty memory-mapped tensor given a shape and possibly a dtype.
Warning
This method is not lock-safe by design. A memory-mapped TensorDict instance present on multiple nodes will need to be updated using the method
memmap_refresh_().Writing an existing entry will result in an error.
- Parameters:
- Keyword Arguments:
- Returns:
A new memory mapped tensor.
Every tensordict class and every tensorclass has this method. For the other methods, see Methods by task.