TorchPayloadCheckpointFile
python
TorchPayloadCheckpointFile(name: str, compress: bool = True) -> NoneBase for checkpoint files that persist a single torch.save payload, optionally zstd-compressed.
Owns the extension/filename compression switch, the compressed/uncompressed save fork and the extension-sniffing load. Subclasses provide the payload via _payload and reconstruct themselves from the loaded data in their own _load, using _load_payload.
Initialize the checkpoint file.
Parameters:
name(str) – The checkpoint file's base name.compress(bool) – Whether to zstd-compress the file.
Properties
filename
python
filename: strMethods
extension
python
extension() -> strGet the default file extension for this checkpoint type.
Returns:
str– The file extension.
extensions
python
extensions() -> tuple[str, ...]Get the compressed and uncompressed extensions this checkpoint type saves with.
Returns:
tuple[str, ...]– The extensions, compressed default first.