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

Method run_loop

tensorflow/python/training/supervisor.py:1079–1099  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1077 self._last_step = training_util.global_step(self._sess, self._step_counter)
1078
1079 def run_loop(self):
1080 # Count the steps.
1081 current_step = training_util.global_step(self._sess, self._step_counter)
1082 added_steps = current_step - self._last_step
1083 self._last_step = current_step
1084 # Measure the elapsed time.
1085 current_time = time.time()
1086 elapsed_time = current_time - self._last_time
1087 self._last_time = current_time
1088 # Reports the number of steps done per second
1089 if elapsed_time > 0.:
1090 steps_per_sec = added_steps / elapsed_time
1091 else:
1092 steps_per_sec = float("inf")
1093 summary = Summary(value=[
1094 Summary.Value(tag=self._summary_tag, simple_value=steps_per_sec)
1095 ])
1096 if self._sv.summary_writer:
1097 self._sv.summary_writer.add_summary(summary, current_step)
1098 logging.log_first_n(logging.INFO, "%s: %g", 10, self._summary_tag,
1099 steps_per_sec)
1100
1101
1102class SVTimerCheckpointThread(coordinator.LooperThread):

Callers

nothing calls this directly

Calls 5

SummaryClass · 0.85
timeMethod · 0.80
global_stepMethod · 0.45
ValueMethod · 0.45
add_summaryMethod · 0.45

Tested by

no test coverage detected