MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / save

Method save

tensorflow/contrib/eager/python/saver.py:145–161  ·  view source on GitHub ↗

Saves variables. Args: file_prefix: Path prefix of files created for the checkpoint. global_step: If provided the global step number is appended to file_prefix to create the checkpoint filename. The optional argument can be a Tensor, a Variable, or an integer. R

(self, file_prefix, global_step=None)

Source from the content-addressed store, hash-verified

143 self._saver = _saver.Saver(var_list=var_list)
144
145 def save(self, file_prefix, global_step=None):
146 """Saves variables.
147
148 Args:
149 file_prefix: Path prefix of files created for the checkpoint.
150 global_step: If provided the global step number is appended to file_prefix
151 to create the checkpoint filename. The optional argument can be a
152 Tensor, a Variable, or an integer.
153
154 Returns:
155 A string: prefix of filenames created for the checkpoint. This may be
156 an extension of file_prefix that is suitable to pass as an argument
157 to a subsequent call to `restore()`.
158 """
159 with ops.device("/device:CPU:0"):
160 return self._saver.save(
161 None, file_prefix, write_meta_graph=False, global_step=global_step)
162
163 def restore(self, file_prefix):
164 """Restores previously saved variables.

Callers 15

setUpMethod · 0.95
setUpMethod · 0.95
_create_checkpointsFunction · 0.95
testBasicsMethod · 0.95
testSameObjectOKMethod · 0.95
testSaveByDictMethod · 0.95
testRestoreOnCreateMethod · 0.95
testRestoreNotFoundMethod · 0.95

Calls 1

deviceMethod · 0.45

Tested by 15

setUpMethod · 0.76
setUpMethod · 0.76
_create_checkpointsFunction · 0.76
testBasicsMethod · 0.76
testSameObjectOKMethod · 0.76
testSaveByDictMethod · 0.76
testRestoreOnCreateMethod · 0.76
testRestoreNotFoundMethod · 0.76