chore: removed redundant assignment in attention block

`nh_kd = nk_kd = self.key_dim ** -0.5`
Removed the redundant assignment to:
`nh_kd = self.key_dim ** -0.5`
This commit is contained in:
Aryan Jassal 2024-07-17 16:37:41 +10:00 committed by GitHub
parent aad320dd80
commit d4535cad1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -776,7 +776,7 @@ class Attention(nn.Module):
self.head_dim = dim // num_heads self.head_dim = dim // num_heads
self.key_dim = int(self.head_dim * attn_ratio) self.key_dim = int(self.head_dim * attn_ratio)
self.scale = self.key_dim ** -0.5 self.scale = self.key_dim ** -0.5
nh_kd = nh_kd = self.key_dim * num_heads nh_kd = self.key_dim * num_heads
h = dim + nh_kd * 2 h = dim + nh_kd * 2
self.qkv = Conv(dim, h, 1, act=False) self.qkv = Conv(dim, h, 1, act=False)
self.proj = Conv(dim, dim, 1, act=False) self.proj = Conv(dim, dim, 1, act=False)