Skip to content

Commit

Permalink
fix tied_pointers_to_remove (#2439)
Browse files Browse the repository at this point in the history
  • Loading branch information
fxmarty authored Feb 13, 2024
1 parent 5318bc7 commit b38590a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/accelerate/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def post_forward(self, module, output):
# this dictionary to allow the garbage collector to do its job.
for value_pointer, device in self.tied_pointers_to_remove:
del self.tied_params_map[value_pointer][device]
self.tied_pointers_to_remove = None
self.tied_pointers_to_remove = set()

if self.io_same_device and self.input_device is not None:
output = send_to_device(output, self.input_device, skip_keys=self.skip_keys)
Expand Down

0 comments on commit b38590a

Please sign in to comment.