def after_run(self, run_context, run_values):
    _ = run_context
    if (not self._summary_writer):
        return
    global_step = run_values.results
    current_time = time.time()
    if (self._last_reported_time is None):
        self._last_reported_step = global_step
        self._last_reported_time = current_time
    elif (global_step >= (self._every_n_steps + self._last_reported_step)):
        added_steps = (global_step - self._last_reported_step)
        elapsed_time = (current_time - self._last_reported_time)
        steps_per_sec = (added_steps / elapsed_time)
        summary = Summary(value=[Summary.Value(tag=self._summary_tag, simple_value=steps_per_sec)])
        self._summary_writer.add_summary(summary, global_step)
        self._last_reported_step = global_step
        self._last_reported_time = current_time
def after_run(self, run_context, run_values):
    _ = run_context
    if (not self._summary_writer):
        return
    global_step = run_values.results
    current_time = time.time()
    if (self._last_reported_time is None):
        self._last_reported_step = global_step
        self._last_reported_time = current_time
    elif (global_step >= (self._every_n_steps + self._last_reported_step)):
        added_steps = (global_step - self._last_reported_step)
        elapsed_time = (current_time - self._last_reported_time)
        steps_per_sec = (added_steps / elapsed_time)
        summary = Summary(value=[Summary.Value(tag=self._summary_tag, simple_value=steps_per_sec)])
        self._summary_writer.add_summary(summary, global_step)
        self._last_reported_step = global_step
        self._last_reported_time = current_time