From fa65507611b1ea39a942b62588c2d5e75d99ea9c Mon Sep 17 00:00:00 2001 From: Fredo Guan Date: Thu, 8 Dec 2022 11:15:37 -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 aa9e9545..024dec04 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(float(windows.shape[0] / (H * W / window_size / window_size))) + B = int(windows.shape[0].item() / (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