Skip to content

Commit c04c8d5

Browse files
authored
Avoiding Basehook object pickling (#266)
1 parent 15ae615 commit c04c8d5

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
@@ -240,6 +240,10 @@ def __init__(
240240
self.training_run = 0
241241
self._initialize_to_last_saved_state()
242242

243+
# This will avoid pickling of BaseHook object
244+
def __getstate__(self):
245+
return {}
246+
243247
def _initialize_to_last_saved_state(self):
244248
self.state_store = StateStore()
245249
last_state = self.state_store.get_last_saved_state()

0 commit comments

Comments
 (0)