Update davit.py

pull/1630/head
Fredo Guan 3 years ago
parent 790f59f768
commit 30503a383a

@ -121,9 +121,8 @@ class PatchEmbed(nn.Module):
C).permute(0, 3, 1, 2).contiguous() C).permute(0, 3, 1, 2).contiguous()
B, C, H, W = x.shape B, C, H, W = x.shape
if W % self.patch_size[1] != 0:
x = F.pad(x, (0, self.patch_size[1] - W % self.patch_size[1])) x = F.pad(x, (0, self.patch_size[1] - W % self.patch_size[1]))
if H % self.patch_size[0] != 0:
x = F.pad(x, (0, 0, 0, self.patch_size[0] - H % self.patch_size[0])) x = F.pad(x, (0, 0, 0, self.patch_size[0] - H % self.patch_size[0]))
x = self.proj(x) x = self.proj(x)

Loading…
Cancel
Save