Skip to content

Commit 8476c5f

Browse files
committed
Close writers before switching modes
1 parent 56143f6 commit 8476c5f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

smdebug/core/hook.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,10 @@ def _write_state(self):
457457
self.state_store.update_state(current_state)
458458

459459
def set_mode(self, mode):
460+
# flush out any writes before switching modes
461+
if self.writer is not None:
462+
self._close_writers()
463+
460464
# train
461465
if mode in ALLOWED_MODES:
462466
self.mode = mode

0 commit comments

Comments
 (0)