Skip to content

Commit c629cd8

Browse files
authored
Merge pull request #25 from HumanCompatibleAI/memory
Mem fix?
2 parents 8a90502 + b555f27 commit c629cd8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/reward_preprocessing/vis/attribution.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ def get_activations(
2121

2222
# Get activations at layer.
2323
act_batch = hook(layer_name)
24-
t_acts.append(act_batch)
24+
t_acts.append(act_batch.detach())
25+
model.zero_grad()
2526

2627
t_acts = th.cat(t_acts, dim=0)
2728
assert t_acts.shape[0] == len(model_inputs)

0 commit comments

Comments
 (0)