load_restart¶
- jaxrens.init.restart.load_restart(path)[source]¶
Load a checkpoint HDF5 file and dispatch based on batch shape.
Reuses
io/checkpoint.load_checkpointas the low-level reader. The return type depends on the checkpoint’slog_evidenceshape:ndim == 0(scalar) →(WalkerSet, RestartBundle)pair. Feedbundleintorun_ns(restart_state=bundle). Backward-compatible with all existing callers that dows, bundle = load_restart(path).ndim == 1(1-D, shape(n_runs,)) →list[RestartBundle]of lengthn_runs. Feed directly intorun_ns_parallel(..., restart_states=load_restart(path)).ndim == 2(2-D, shape(G, P)) →list[list[RestartBundle]]of shape(G, P). Feed directly intorun_ns_multi_gpu(..., restart_states=load_restart(path)).ndim >= 3→ raisesValueErrorwith a message mentioningndim.
Dead arrays in each
RestartBundleare the compact slices trimmed ton_deadentries (not padded).init_nspads them into pre-allocated arrays of sizemax_dead.The list of sliceable fields is derived from
dataclasses.fields(RestartBundle)at call time, so adding a new field toRestartBundleis automatically reflected without modifying this function.- Parameters:
path (Path) – Path to the checkpoint HDF5 file.
- Returns:
see above.
- Return type:
Shape-dependent
- Raises:
FileNotFoundError – if path does not exist.
ValueError – if the file is missing required NS-state fields, or if
log_evidence.ndim >= 3.