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

Method __init__

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

A tf.compat.v1.train.Saver adapter for use when eager execution is enabled. The API, and on-disk format, mimic tf.compat.v1.train.Saver except that no Session is needed. Args: var_list: The list of variables that will be saved and restored. Either a list of `tf.Varia

(self, var_list)

Source from the content-addressed store, hash-verified

123 """
124
125 def __init__(self, var_list):
126 """A tf.compat.v1.train.Saver adapter for use when eager execution is enabled.
127
128 The API, and on-disk format, mimic tf.compat.v1.train.Saver except that no
129 Session is needed.
130
131 Args:
132 var_list: The list of variables that will be saved and restored. Either a
133 list of `tf.Variable` objects, or a dictionary mapping names to
134 `tf.Variable` objects.
135
136 Raises:
137 RuntimeError: if invoked when eager execution has not been enabled.
138 """
139 if not context.executing_eagerly():
140 raise RuntimeError("tfe.Saver can only be used when eager "
141 "execution is enabled. Use tf.train.Saver when "
142 "building graphs.")
143 self._saver = _saver.Saver(var_list=var_list)
144
145 def save(self, file_prefix, global_step=None):
146 """Saves variables.

Callers

nothing calls this directly

Calls 1

executing_eagerlyMethod · 0.80

Tested by

no test coverage detected