def __init__(
        self,
        storage: CheckpointStorage,
        map_location: Optional[Union[str, torch.device, Dict[str, str]]] = None,
    ):
        """
        Creates an instance of the checkpoint plugin.

        :param storage: The checkpoint storage to use. The most common one is
            :class:`FileSystemCheckpointStorage`.
        :param map_location: This parameter can change where the cuda tensors
            (including the model ones) are put when loading checkpoints.
            This works similar to the `map_location` parameter of `torch.load`,
            except that you can also pass a device object or a string (a proper
            map will be created accordingly). The recommended way to use this
            parameter is to pass the used reference device.
            In addition, all `torch.device` objects will be un-pickled using
            that map (this is not usually done by `torch.load`,
            but it is needed to properly manage things in Avalanche).
            Defaults to None, which means that no mapping will take place.
        """
        raise ValueError(
            "Please use `save_checkpoint` and " "`maybe_load_checkpoint` " "instead."
        )

        Creates an instance of the checkpoint plugin.

        :param storage: The checkpoint storage to use. The most common one is
            :class:`FileSystemCheckpointStorage`.
        :param map_location: This parameter can change where the cuda tensors
            (including the model ones) are put when loading checkpoints.
            This works similar to the `map_location` parameter of `torch.load`,
            except that you can also pass a device object or a string (a proper
            map will be created accordingly). The recommended way to use this
            parameter is to pass the used reference device.
            In addition, all `torch.device` objects will be un-pickled using
            that map (this is not usually done by `torch.load`,
            but it is needed to properly manage things in Avalanche).
            Defaults to None, which means that no mapping will take place.
        
avalanche/training/plugins/checkpoint.py