Skip to content

Commit e0b4588

Browse files
authored
Update output_hook.py
1 parent c3f9a54 commit e0b4588

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

captum/optim/_core/output_hook.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ def __init__(self, target_modules: Iterable[nn.Module]) -> None:
1616
1717
target_modules (Iterable of nn.Module): A list of nn.Module targets.
1818
"""
19-
for module in target_modules:
20-
# Clean up any old hooks that weren't properly deleted
21-
_remove_all_forward_hooks(module, "module_outputs_forward_hook")
2219
self.outputs: ModuleOutputMapping = dict.fromkeys(target_modules, None)
2320
self.hooks = [
2421
module.register_forward_hook(self._forward_hook())

0 commit comments

Comments
 (0)