try gtp vit

This commit is contained in:
thanhvc3 2024-04-28 15:40:31 +07:00
parent 3b6db89be1
commit 47bc661a91

View File

@ -1247,7 +1247,7 @@ class PoolFormerBlock(nn.Module):
x_attn = window_reverse(attn_windows, self.window_size, H, W)
index_kept, index_prop = select(x_attn, standard="MixedAttnMax", num_prop=0,
cls_token=False)
original_shape = x.attn.shape
original_shape = x_attn.shape
x_attn = x_attn.view(-1, self.window_size * self.window_size, C)
x_attn, weight, token_scales = propagate(x_attn, weight, index_kept, index_prop, standard="GraphProp",
alpha=0.1, token_scales=token_scales, cls_token=False)