Update davit.py

pull/1630/head
Fredo Guan 3 years ago
parent fb90cb1503
commit ed249d1a26

@ -669,13 +669,13 @@ class DaViTStage(nn.Module):
self.blocks = nn.Sequential(*stage_blocks) self.blocks = nn.Sequential(*stage_blocks)
def forward(self, x : Tensor, size: Tuple[int, int]): def forward(self, x : Tensor):
x, size = self.patch_embed(x, size) x = self.patch_embed(x)
if self.grad_checkpointing and not torch.jit.is_scripting(): if self.grad_checkpointing and not torch.jit.is_scripting():
x, size = checkpoint_seq(self.blocks, x, size) x = checkpoint_seq(self.blocks, x)
else: else:
x, size = self.blocks(x, size) x = self.blocks(x)
return x, size return x
class DaViT(nn.Module): class DaViT(nn.Module):

Loading…
Cancel
Save