mirror of
https://github.com/THU-MIG/yolov10.git
synced 2025-05-23 13:34:23 +08:00
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:
parent
aad320dd80
commit
d4535cad1c
@ -776,7 +776,7 @@ class Attention(nn.Module):
|
||||
self.head_dim = dim // num_heads
|
||||
self.key_dim = int(self.head_dim * attn_ratio)
|
||||
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
|
||||
self.qkv = Conv(dim, h, 1, act=False)
|
||||
self.proj = Conv(dim, dim, 1, act=False)
|
||||
@ -824,4 +824,4 @@ class SCDown(nn.Module):
|
||||
self.cv2 = Conv(c2, c2, k=k, s=s, g=c2, act=False)
|
||||
|
||||
def forward(self, x):
|
||||
return self.cv2(self.cv1(x))
|
||||
return self.cv2(self.cv1(x))
|
||||
|
Loading…
x
Reference in New Issue
Block a user