Skip to content

Commit aac764c

Browse files
committed
Update dependencyvit.py
1 parent 5edd3a3 commit aac764c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

timm/models/dependencyvit.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,12 @@ def forward(self, x: torch.Tensor, m: torch.Tensor) -> Tuple[torch.Tensor, torch
115115

116116
#prune_mask = attn.detach().sum(1).sum(-1)
117117
#prune_mask = attn.detach().sum(1).abs().sum(-1)
118-
prune_mask = attn.detach().abs().sum((1, -1))
118+
#prune_mask = attn.detach().abs().sum((1, -1))
119119
#prune_mask = attn.sum(1).sum(-1)
120120
#prune_mask = attn.sum(1).abs().sum(-1)
121121
#prune_mask = attn.abs().sum((1, -1))
122122
#prune_mask = m.reshape(B, N)
123+
purne_mask = m.detach().reshape(B, N)
123124

124125
x = self.proj(x)
125126
x = self.proj_drop(x)

0 commit comments

Comments
 (0)