refresh_archive_checksums¶
- class tensordict.refresh_archive_checksums(archive_path: str | pathlib.Path)¶
Recomputes the CRC-32 checksums of a memmap archive after in-place writes.
A tensordict loaded with
TensorDict.load_memmap(path, mode="r+")writes through to the archive without updating the CRC-32 that the zip format stores for each entry.load_memmap()itself never verifies checksums, so this is only needed before handing the modified archive to tools that do (unzip,zipfile,unpack_memmap()).- Parameters:
archive_path (str or Path) – path to the archive to fix up.
- Returns:
the path to the archive.