Overwrite an existing state buffer in place from a saved snapshot.
Used by Optimizer::load_state_buffers to restore a checkpoint
into the optimizer's live state without reallocating or rebinding
any storage objects. dst keeps its identity (pointer, shape,
dtype, device) — only the underlying bytes / MLX array are replaced.
See Also
clone_state_storage : produces the snapshots consumed here.
Parameters
dstStorage&Live optimizer state buffer to update in place.
srcconst Storage&Snapshot whose contents should be written into
dst. Must be on the same device as dst and have the same byte size.Raises
:runtime_errorIf
dst and src are on different devices, or if their CPU byte sizes disagree.