def after_run(self, run_context, run_values):
    global_step = run_values.results
    if (self._last_step is None):
        self._last_step = ((global_step + self._num_steps) - 1)
    if (global_step >= self._last_step):
        run_context.request_stop()
def after_run(self, run_context, run_values):
    global_step = run_values.results
    if (self._last_step is None):
        self._last_step = ((global_step + self._num_steps) - 1)
    if (global_step >= self._last_step):
        run_context.request_stop()