This commit is contained in:
thanhvc3 2024-04-27 10:59:11 +07:00
parent b77c79708e
commit 28a8352044

View File

@ -787,7 +787,7 @@ class WindowAttention(nn.Module):
mask: (0/-inf) mask with shape of (num_windows, Wh*Ww, Wh*Ww) or None mask: (0/-inf) mask with shape of (num_windows, Wh*Ww, Wh*Ww) or None
""" """
print(x.shape) print(x.shape)
B_, N, C, _ = x.shape B_, C, N, _ = x.shape
qkv_bias = None qkv_bias = None
if self.q_bias is not None: if self.q_bias is not None:
qkv_bias = torch.cat((self.q_bias, torch.zeros_like(self.v_bias, requires_grad=False), self.v_bias)) qkv_bias = torch.cat((self.q_bias, torch.zeros_like(self.v_bias, requires_grad=False), self.v_bias))