Update davit.py

pull/1630/head
Fredo Guan 3 years ago
parent b62aef9586
commit b0494271f0

@ -165,10 +165,12 @@ class PatchEmbed(nn.Module):
if self.norm.normalized_shape[0] == self.in_chans:
x = self.norm(x.permute(0, 2, 3, 1)).permute(0, 3, 1, 2)
print(self.patch_size[1] - W % self.patch_size[1])
print(self.patch_size[0] - H % self.patch_size[0])
x = F.pad(x, (0, self.patch_size[1] - torch.floor(W % self.patch_size[1])))
x = F.pad(x, (0, self.patch_size[1] - W % self.patch_size[1]))
x = F.pad(x, (0, 0, 0, self.patch_size[0] - torch.floor(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)

Loading…
Cancel
Save