MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / _run_init

Method _run_init

tensorpack/tfutils/sessinit.py:178–193  ·  view source on GitHub ↗
(self, sess)

Source from the content-addressed store, hash-verified

176 pass
177
178 def _run_init(self, sess):
179 logger.info(
180 "Restoring checkpoint from {} ...".format(self.path))
181
182 matched_pairs = []
183
184 def f(reader, name, v):
185 val = reader.get_tensor(name)
186 val = SessionUpdate.relaxed_value_for_var(val, v, ignore_mismatch=True)
187 if val is not None:
188 matched_pairs.append((v, val))
189
190 with sess.as_default():
191 self._match_vars(f)
192 upd = SessionUpdate(sess, [x[0] for x in matched_pairs])
193 upd.update({x[0].name: x[1] for x in matched_pairs})
194
195
196class DictRestore(SessionInit):

Callers

nothing calls this directly

Calls 4

updateMethod · 0.95
SessionUpdateClass · 0.85
formatMethod · 0.80
_match_varsMethod · 0.80

Tested by

no test coverage detected