backup
This commit is contained in:
@@ -196,4 +196,10 @@ def sparse_to_tensor(L):
|
||||
idx = np.mat([L.row, L.col]).transpose().astype(np.float32)
|
||||
data = L.data.astype(dtype=np.float32)
|
||||
shape = L.shape
|
||||
return tf.SparseTensor(idx, data, shape)
|
||||
return tf.SparseTensor(idx, data, shape)
|
||||
|
||||
|
||||
def load_model(model, checkpoint):
|
||||
ckpt = tf.train.Checkpoint(model=model)
|
||||
manager = tf.train.CheckpointManager(ckpt, checkpoint, max_to_keep=1)
|
||||
ckpt.restore(manager.latest_checkpoint)
|
||||
|
||||
Reference in New Issue
Block a user