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(), orloadifparams().- Returns:
Returns
Trueis the the load_attempt failed, elseFalse.- Return type:
bool
Notes
Example use:
if failed(obj := SaveableObject.loadif(*args, path="filename.pkl", **kwargs)): ... # code that generates obj ... # code that uses obj