class_docstr: Base class for all strategies that change the behaviour of the training, validation and test- loop.
class_docstr_tok: ["Base","class","for","all","strategies","that","change","the","behaviour","of","the","training",",","validation","and","test-","loop","."]
docstr: Save model, optimizer, and other state as a checkpoint file.
  
  Args:
      path: A path to where the file(s) should be saved
      state: A dictionary with contents to be saved. If the dict contains modules or optimizers, their
          state-dict will be retrieved and converted automatically.
      storage_options: Additional options for the ``CheckpointIO`` plugin
      filter: An optional dictionary containing filter callables that return a boolean indicating whether the
          given item should be saved (``True``) or filtered out (``False``). Each filter key should match a
          state key, where its filter will be applied to the ``state_dict`` generated.
docstr_tok: ["Save","model",",","optimizer",",","and","other","state","as","a","checkpoint","file",".","Args",":","path",":","A","path","to","where","the","file","(","s",")","should","be","saved","state",":","A","dictionary","with","contents","to","be","saved",".","If","the","dict","contains","modules","or","optimizers",",","their","state-dict","will","be","retrieved","and","converted","automatically",".","storage_options",":","Additional","options","for","the","``","CheckpointIO","``","plugin","filter",":","An","optional","dictionary","containing","filter","callables","that","return","a","boolean","indicating","whether","the","given","item","should","be","saved","(","``","True","``",")","or","filtered","out","(","``","False","``",")",".","Each","filter","key","should","match","a","state","key",",","where","its","filter","will","be","applied","to","the","``","state_dict","``","generated","."]
code: def save_checkpoint(
      self,
      path: _PATH,
      state: Dict[str, Union[Module, Optimizer, Any]],
      storage_options: Optional[Any] = None,
      filter: Optional[Dict[str, Callable[[str, Any], bool]]] = None,
  ) -> None:
      """Save model, optimizer, and other state as a checkpoint file.
  
      Args:
          path: A path to where the file(s) should be saved
          state: A dictionary with contents to be saved. If the dict contains modules or optimizers, their
              state-dict will be retrieved and converted automatically.
          storage_options: Additional options for the ``CheckpointIO`` plugin
          filter: An optional dictionary containing filter callables that return a boolean indicating whether the
              given item should be saved (``True``) or filtered out (``False``). Each filter key should match a
              state key, where its filter will be applied to the ``state_dict`` generated.
  
      """
      state = self._convert_stateful_objects_in_state(
          state, filter=(filter or {})
      )
      if self.is_global_zero:
          self.checkpoint_io.save_checkpoint(
              checkpoint=state,
              path=path,
              storage_options=storage_options,
          )
  
imports: import logging
  from abc import ABC, abstractmethod
  from contextlib import ExitStack
  from typing import Any, Callable, ContextManager, Dict, Iterable, List, Optional, Tuple, TypeVar, Union
  import torch
  from torch import Tensor
  from torch.nn import Module
  from torch.optim import Optimizer
  from torch.utils.data import DataLoader
  from lightning.fabric.accelerators import Accelerator
  from lightning.fabric.plugins.io.checkpoint_io import CheckpointIO
  from lightning.fabric.plugins.io.torch_io import TorchCheckpointIO
  from lightning.fabric.plugins.precision import Precision
  from lightning.fabric.strategies.launchers.launcher import _Launcher
  from lightning.fabric.strategies.registry import _StrategyRegistry
  from lightning.fabric.utilities.apply_func import move_data_to_device
  from lightning.fabric.utilities.imports import _TORCH_GREATER_EQUAL_1_13, _TORCH_GREATER_EQUAL_2_0
  from lightning.fabric.utilities.init import _EmptyInit
  from lightning.fabric.utilities.types import _PATH, Optimizable, ReduceOp, _Stateful
label_desc: Use image node_id 28 for calling the Strategy obj's underlying member method code with example usage: obj.save_checkpoint(path, state, storage_options, filter) without return types