Skip to content

Commit cfa8c40

Browse files
committed
todo comment
1 parent 81b2678 commit cfa8c40

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/transformers/utils/generic.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,10 @@ def capture_fn(module, input, output):
991991
capture_flags = self._can_record_outputs.keys()
992992
recordable_keys = {f"output_{k}": kwargs.get(f"output_{k}", False) for k in capture_flags}
993993
if any(recordable_keys.values()):
994-
for _, layer in self.named_modules():
994+
for (
995+
_,
996+
layer,
997+
) in self.named_modules(): # pretty sure we gotta attache the hooks to an instance and not a class
995998
for key, (cls, idx) in self._can_record_outputs.items():
996999
if capture_flags.get(key, False) and isinstance(layer, cls):
9971000
hook_fn = make_capture_fn(key, idx)

0 commit comments

Comments
 (0)