From b9952023f619224987880c8025da54d88f4b2900 Mon Sep 17 00:00:00 2001 From: Yonghye Kwon Date: Fri, 30 May 2025 09:08:38 +0900 Subject: [PATCH] fix a bug --- dysample.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dysample.py b/dysample.py index 356ef45..3b31a03 100644 --- a/dysample.py +++ b/dysample.py @@ -55,7 +55,7 @@ def sample(self, x, offset): ).transpose(1, 2).unsqueeze(1).unsqueeze(0).type(x.dtype).to(x.device) normalizer = torch.tensor([W, H], dtype=x.dtype, device=x.device).view(1, 2, 1, 1, 1) coords = 2 * (coords + offset) / normalizer - 1 - coords = F.pixel_shuffle(coords.view(B, -1, H, W), self.scale).view( + coords = F.pixel_shuffle(coords.reshape(B, -1, H, W), self.scale).view( B, 2, -1, self.scale * H, self.scale * W).permute(0, 2, 3, 4, 1).contiguous().flatten(0, 1) return F.grid_sample(x.reshape(B * self.groups, -1, H, W), coords, mode='bilinear', align_corners=False, padding_mode="border").view(B, -1, self.scale * H, self.scale * W)