§
    “©ºj‡  ã                   óN   — d dl mZmZ d dlmZmZ d dlmZ  G d„ de¦  «        ZdS )é    )ÚABCÚabstractmethod)ÚAnyÚOptional)Ú_PATHc                   óÔ   — e Zd ZdZeddeeef         dede	e         ddfd„¦   «         Z
e	 ddede	e         d	e	e         deeef         fd
„¦   «         Zededdfd„¦   «         Zdd„ZdS )ÚCheckpointIOa~  Interface to save/load checkpoints as they are saved through the ``Strategy``.

    .. warning::  This is an :ref:`experimental <versioning:Experimental API>` feature.

    Typically most plugins either use the Torch based IO Plugin; ``TorchCheckpointIO`` but may
    require particular handling depending on the plugin.

    In addition, you can pass a custom ``CheckpointIO`` by extending this class and passing it
    to the Trainer, i.e ``Trainer(plugins=[MyCustomCheckpointIO()])``.

    .. note::

        For some plugins, it is not possible to use a custom checkpoint plugin as checkpointing logic is not
        modifiable.

    NÚ
checkpointÚpathÚstorage_optionsÚreturnc                 ó   — dS )a'  Save model/training states as a checkpoint file through state-dump and file-write.

        Args:
            checkpoint: dict containing model and trainer state
            path: write-target path
            storage_options: Optional parameters when saving the model/training states.

        N© )Úselfr
   r   r   s       úy/root/private/project/pallet_detection_v2/.venv/lib/python3.11/site-packages/lightning_fabric/plugins/io/checkpoint_io.pyÚsave_checkpointzCheckpointIO.save_checkpoint&   ó   € € € ó    Úmap_locationÚweights_onlyc                 ó   — dS )a‰  Load checkpoint from a path when resuming or loading ckpt for test/validate/predict stages.

        Args:
            path: Path to checkpoint
            map_location: a function, :class:`torch.device`, string or a dict specifying how to remap storage
                locations.
            weights_only: Defaults to ``None``. If ``True``, restricts loading to ``state_dicts`` of plain
                ``torch.Tensor`` and other primitive types. If loading a checkpoint from a trusted source that contains
                an ``nn.Module``, use ``weights_only=False``. If loading checkpoint from an untrusted source, we
                recommend using ``weights_only=True``. For more information, please refer to the
                `PyTorch Developer Notes on Serialization Semantics <https://docs.pytorch.org/docs/main/notes/serialization.html#id3>`_.

        Returns: The loaded checkpoint.

        Nr   )r   r   r   r   s       r   Úload_checkpointzCheckpointIO.load_checkpoint1   r   r   c                 ó   — dS )ziRemove checkpoint file from the filesystem.

        Args:
            path: Path to checkpoint

        Nr   )r   r   s     r   Úremove_checkpointzCheckpointIO.remove_checkpointE   r   r   c                 ó   — dS )z.This method is called to teardown the process.Nr   )r   s    r   ÚteardownzCheckpointIO.teardownN   r   r   )N)NN)r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚdictÚstrr   r   r   r   Úboolr   r   r   r   r   r   r	   r	      s
  € € € € € ðð ð" ðð ¨$¨s°C¨x¬.ð Àð ÐX`ÐadÔXeð Ðquð ð ð ñ „^ðð à^bðð ØðØ)1°#¬ðØMUÐVZÌ^ðà	ˆc�3ˆhŒðð ð ñ „^ðð& ð eð °ð ð ð ñ „^ðð=ð =ð =ð =ð =ð =r   r	   N)	Úabcr   r   Útypingr   r   Ú lightning_fabric.utilities.typesr   r	   r   r   r   ú<module>r'      s}   ðð $Ð #Ð #Ð #Ð #Ð #Ð #Ð #Ø  Ð  Ð  Ð  Ð  Ð  Ð  Ð  à 2Ð 2Ð 2Ð 2Ð 2Ð 2ð;=ð ;=ð ;=ð ;=ð ;=�3ñ ;=ô ;=ð ;=ð ;=ð ;=r   