提交 9d985340 编写于 作者: T tangwei12

update annotation grammar

上级 27b71751
...@@ -464,10 +464,10 @@ def save_checkpoint(executor, ...@@ -464,10 +464,10 @@ def save_checkpoint(executor,
main_program=None): main_program=None):
""" """
Save Checkpoint will save persistable LodTensor variables from main_program in checkpoint directory, Save Checkpoint will save persistable LodTensor variables from main_program in checkpoint directory,
directory named by serial number from 0 to (n -1), save_checkpoint use LRU strategy the directory named by serial number from 0 to (n -1), save_checkpoint use LRU strategy
to keep numbers of checkpoint directory, the numbers of checkpoint directory are max_num_checkpoints at most, to keep numbers of checkpoint directory, the numbers of checkpoint directory are max_num_checkpoints at most,
The interval time between two save_checkpoint must great than or equal to save_interval_secs. The interval time between two save_checkpoint must great than or equal to save_interval_secs.
:param dirname :param dirname
:param max_num_checkpoints :param max_num_checkpoints
:param save_secs :param save_secs
...@@ -500,8 +500,8 @@ def save_checkpoint(executor, ...@@ -500,8 +500,8 @@ def save_checkpoint(executor,
def load_checkpoint(executor, dirname=None, main_program=None): def load_checkpoint(executor, dirname=None, main_program=None):
""" """
Load checkpoint from directory by executor, Load checkpoint from a directory by executor,
it will find lastest checkpoint file and load it auto. it will find latest checkpoint file and load it auto.
:param executor :param executor
:param dirname :param dirname
...@@ -527,9 +527,9 @@ def load_checkpoint(executor, dirname=None, main_program=None): ...@@ -527,9 +527,9 @@ def load_checkpoint(executor, dirname=None, main_program=None):
def _is_checkpoint_var(var): def _is_checkpoint_var(var):
""" """
checkpoint will not save or load all the variables. the checkpoint will not save or load all the variables.
var type is FEED_MINIBATCH/FETCH_LIST/RAW and var name is end with @GRAD are discarded. var type is FEED_MINIBATCH/FETCH_LIST/RAW or var name ends with @GRAD are discarded.
:param var :param var
""" """
if var.desc.type() == core.VarDesc.VarType.FEED_MINIBATCH or \ if var.desc.type() == core.VarDesc.VarType.FEED_MINIBATCH or \
...@@ -571,7 +571,7 @@ def _lru_delete(dirname, max_num_checkpoints=3): ...@@ -571,7 +571,7 @@ def _lru_delete(dirname, max_num_checkpoints=3):
def _write_success(dirname): def _write_success(dirname):
""" """
write an empty _SUCCESS file to checkpoint dir, indicate this checkpoint is correct. write an empty file named "_SUCCESS" in checkpoint dir, indicate this checkpoint is correct.
:param dirname :param dirname
""" """
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册