Skip to content

Commit

Permalink
amend
Browse files Browse the repository at this point in the history
  • Loading branch information
vmoens committed Oct 19, 2023
1 parent af7f289 commit 3e31297
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tensordict/memmap_refact.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,12 @@ def from_handler(cls, handler, dtype, shape, index):
return out

def __setstate__(self, state):
print('setstate', self.__dict__)
if 'filename' in state:
self.__dict__.update(type(self).from_filename(**state).__dict__)
else:
self.__dict__.update(type(self).from_handler(**state).__dict__)
assert self.is_shared()

def __getstate__(self):
if getattr(self, "_handler", None) is not None:
Expand Down

0 comments on commit 3e31297

Please sign in to comment.