diff options
author | A. Unique TensorFlower <nobody@tensorflow.org> | 2016-03-08 13:35:39 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-03-08 17:20:16 -0800 |
commit | 8e13e68efcdb96862ce32f9b2a138ca8fac78ec6 (patch) | |
tree | d9f52922b211bcb706249358785f8361aad3bfed /tensorflow/python/training/coordinator.py | |
parent | f0d630445fbe7fa7538ea6acf52f58cbf12bf1c1 (diff) |
Add stop_loop to LooperThread to enable cleanups.
Change: 116691546
Diffstat (limited to 'tensorflow/python/training/coordinator.py')
-rw-r--r-- | tensorflow/python/training/coordinator.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tensorflow/python/training/coordinator.py b/tensorflow/python/training/coordinator.py index 6bc36429d9..661bae7bc1 100644 --- a/tensorflow/python/training/coordinator.py +++ b/tensorflow/python/training/coordinator.py @@ -335,7 +335,6 @@ class LooperThread(threading.Thread): looper.start() return looper - # pylint: disable=broad-except def run(self): with self._coord.stop_on_exception(): self.start_loop() @@ -349,12 +348,16 @@ class LooperThread(threading.Thread): while not self._coord.wait_for_stop(next_timer_time - time.time()): next_timer_time += self._timer_interval_secs self.run_loop() - # pylint: enable=broad-except + self.stop_loop() def start_loop(self): """Called when the thread starts.""" pass + def stop_loop(self): + """Called when the thread stops.""" + pass + def run_loop(self): """Called at 'timer_interval_secs' boundaries.""" if self._target: |