saveable_objects.checkpointing.failed

saveable_objects.checkpointing.failed(load_attempt: SaveableObject | bool | Tuple[SaveableObject, bool]) bool[source]

Determines if a SaveableObject .load(), .tryload(), .loadif(), or .loadifparams() attempt fails.

Parameters:

load_attempt (SaveableObject | bool | (SaveableObject, bool)) – The output of load(), tryload(), loadif(), or loadifparams().

Returns:

Returns True is the the load_attempt failed, else False.

Return type:

bool

Notes

Example use:

if failed(obj := SaveableObject.loadif(*args, path="filename.pkl", **kwargs)):
    ... # code that generates obj
... # code that uses obj