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

Method after_run

tensorflow/python/tpu/session_support.py:371–394  ·  view source on GitHub ↗
(self, run_context, run_values)

Source from the content-addressed store, hash-verified

369 return savers[0]
370
371 def after_run(self, run_context, run_values):
372 del run_values
373 if not self._heartbeat_supported:
374 return
375
376 lame_workers = self._workers.lame_workers()
377
378 if lame_workers:
379 logging.info('ShutdownHook: lame workers found: %s', lame_workers)
380
381 if self.saver():
382 logging.info('ShutdownHook: saving checkpoint to %s',
383 self._checkpoint_prefix)
384 self.saver().save(
385 run_context.session,
386 self._checkpoint_prefix,
387 global_step=training_util.get_global_step(),
388 write_state=True,
389 )
390 else:
391 logging.info('ShutdownHook: no Saver defined.')
392
393 for fn in self._on_shutdown_hooks:
394 fn(run_context, self._workers, lame_workers)
395
396
397class ResetComputation(object):

Callers

nothing calls this directly

Calls 5

saverMethod · 0.95
lame_workersMethod · 0.80
infoMethod · 0.80
fnFunction · 0.50
saveMethod · 0.45

Tested by

no test coverage detected