SwinTransformer中SW-MSA中attn_mask生成逻辑纪录
令input_resolution = (12, 12)window_size = 6shift_size = 3生成部分的源码如下: if self.shift_size > 0: # calculate attention mask for SW-MSA H, W = self.input_resolution img_mask = torch.zeros((1, H, W, 1)) # 1 H W 1
原创
2021-08-03 10:57:02 ·
1529 阅读 ·
0 评论