(windows: torch.Tensor, win: Tuple[int, int, int], orig: Tuple[int, int, int])
| 103 | |
| 104 | @staticmethod |
| 105 | def reverse(windows: torch.Tensor, win: Tuple[int, int, int], orig: Tuple[int, int, int]): |
| 106 | F, H, W = orig |
| 107 | wf, wh, ww = win |
| 108 | nf, nh, nw = F // wf, H // wh, W // ww |
| 109 | B = windows.size(0) // (nf * nh * nw) |
| 110 | x = windows.view(B, nf, nh, nw, wf, wh, ww, -1) |
| 111 | x = x.permute(0, 1, 4, 2, 5, 3, 6, 7).contiguous() |
| 112 | return x.view(B, F, H, W, -1) |
| 113 | |
| 114 | |
| 115 | @torch.no_grad() |