Update davit.py

pull/1630/head
Fredo Guan 2 years ago
parent fa65507611
commit b81a6ef30e

@ -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].item() / (H * W / window_size / window_size))
B = int(float(windows.shape[0]) / float(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

Loading…
Cancel
Save