From 1a3f9419997b812aa9cbac566363c1629e01309a Mon Sep 17 00:00:00 2001 From: hwijeen Date: Fri, 24 Nov 2023 10:31:22 -0500 Subject: [PATCH] flush only when saving --- analog/analog.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/analog/analog.py b/analog/analog.py index 8231a589..4970e1c2 100644 --- a/analog/analog.py +++ b/analog/analog.py @@ -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()