OliverRensu / Shunted-Transformer

209 stars 20 forks source link

你好 OverlapPatchEmbed 类中的问题? #25

Open AustinYuAo opened 1 year ago

AustinYuAo commented 1 year ago

class OverlapPatchEmbed(nn.Module): """ Image to Patch Embedding """

def __init__(self, img_size=224, patch_size=7, stride=4, in_chans=3, embed_dim=768):
    super().__init__()
    img_size = to_2tuple(img_size)
    patch_size = to_2tuple(patch_size)

    self.img_size = img_size
    self.patch_size = patch_size
    self.H, self.W = img_size[0] // patch_size[0], img_size[1] // patch_size[1]
    self.num_patches = self.H * self.W

你好 OverlapPatchEmbed 类中的这里进行的计算后续也没有用到啊? 有什么特别意义吗?