From fe7b9e6bbefcdb5c3e07f5098197d10140e147d3 Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Thu, 8 Dec 2022 11:09:12 -0800 Subject: [PATCH] Update davit.py --- timm/models/davit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timm/models/davit.py b/timm/models/davit.py index 48b387c4..22e892f3 100644 --- a/timm/models/davit.py +++ b/timm/models/davit.py @@ -215,7 +215,7 @@ def window_reverse(windows : Tensor, window_size: int, H: int, W: int): Returns: x: (B, H, W, C) """ - B = int(windows.shape[0] / (H * W / window_size / window_size)) + B = torch.floor(windows.shape[0] / (H * W / window_size / window_size)) x = windows.view(B, H // window_size, W // window_size, window_size, window_size, -1) x = x.permute(0, 1, 3, 2, 4, 5).contiguous().view(B, H, W, -1) return x