Skip to content

Commit

Permalink
Debug network_swin2sr
Browse files Browse the repository at this point in the history
  • Loading branch information
Choiuijin1125 committed Sep 27, 2022
1 parent fd9c1ad commit 0abb1e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/network_swin2sr.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 148,7 @@ def forward(self, x, mask=None):

# cosine attention
attn = (F.normalize(q, dim=-1) @ F.normalize(k, dim=-1).transpose(-2, -1))
logit_scale = torch.clamp(self.logit_scale, max=torch.log(torch.tensor(1. / 0.01))).exp()
logit_scale = torch.clamp(self.logit_scale, max=torch.log(torch.tensor(1. / 0.01)).to(self.logit_scale.device)).exp()
attn = attn * logit_scale

relative_position_bias_table = self.cpb_mlp(self.relative_coords_table).view(-1, self.num_heads)
Expand Down

0 comments on commit 0abb1e0

Please sign in to comment.