Source code for lathe.checkpoint
import numpy as np
import errno
[docs]def load(path):
checkpoint = None
try:
checkpoint = np.load(open(path, 'rb'))[()]
except IOError as e:
# if file doesn't exist then we assume the user wants to create it
if e.errno != errno.EEXIST:
raise
return checkpoint