Skip to content

Commit

Permalink
add reset
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobgil committed Dec 31, 2020
1 parent 4f75bc6 commit 1d68f22
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions vit_rollout.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def get_attention(self, module, input, output):
self.attentions.append(output.cpu())

def __call__(self, input_tensor):
self.attentions = []
with torch.no_grad():
output = self.model(input_tensor)

Expand Down

0 comments on commit 1d68f22

Please sign in to comment.