Load a cache from disk.
(cls, path: str | pathlib.Path, device: torch.device)
| 111 | |
| 112 | @classmethod |
| 113 | def from_disk(cls, path: str | pathlib.Path, device: torch.device) -> "TensorCache": |
| 114 | """Load a cache from disk.""" |
| 115 | return cls(tensors=torch.load(path, weights_only=True, map_location=device)) |
| 116 | |
| 117 | |
| 118 | @dataclass |