Skip to content

Commit

Permalink
flush only when saving
Browse files Browse the repository at this point in the history
  • Loading branch information
hwijeen committed Nov 24, 2023
1 parent 05e37ca commit 1a3f941
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion analog/analog.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ def __exit__(self, exc_type, exc_value, traceback) -> None:
interfere with further operations on the model or with future logging sessions.
"""
self.hessian_handler.on_exit(self.logging_handler.current_log)
self.storage_handler.flush()
if self.save:
self.storage_handler.flush()
self.logging_handler.clear()

self.reset()
Expand Down

0 comments on commit 1a3f941

Please sign in to comment.