code: def _atomic_save(
      checkpoint: Dict[str, Any], filepath: Union[str, Path]
  ) -> None:
      """Saves a checkpoint atomically, avoiding the creation of incomplete checkpoints.
  
      Args:
          checkpoint: The object to save.
              Built to be used with the ``dump_checkpoint`` method, but can deal with anything which ``torch.save``
              accepts.
          filepath: The path to which the checkpoint will be saved.
              This points to the file that the checkpoint will be stored in.
      """
      bytesbuffer = io.BytesIO()
      torch.save(checkpoint, bytesbuffer)
      with fsspec.open(filepath, "wb") as f:
          f.write(bytesbuffer.getvalue())
  
file_path: autogluon/multimodal/src/autogluon/multimodal/utils/cloud_io.py
imports: import io
  from pathlib import Path
  from typing import IO, Any, Callable, Dict, Optional, Union
  import fsspec
  import torch
  from fsspec.core import url_to_fs
  from fsspec.implementations.local import AbstractFileSystem
label_desc: Use image node_id 3 for calling a global function with example usage: _atomic_save(checkpoint, filepath) without return types