revert changes

This commit is contained in:
Ethan Weber committed 2023-08-04 15:23:55 +00:00
1 parent 00b81cce28
commit 4ac5fa8e61
1 file changed
+12 -12
+12 -12
View File
@@ -329,20 +329,20 @@ class PatchPixelSampler(PixelSampler):
device=device,
)
indices = (
indices.view(sub_bs, 1, 1, 3)
.broadcast_to(sub_bs, self.config.patch_size, self.config.patch_size, 3)
.clone()
)
indices = (
indices.view(sub_bs, 1, 1, 3)
.broadcast_to(sub_bs, self.config.patch_size, self.config.patch_size, 3)
.clone()
)
yys, xxs = torch.meshgrid(
torch.arange(self.config.patch_size, device=device), torch.arange(self.config.patch_size, device=device)
)
indices[:, ..., 1] += yys
indices[:, ..., 2] += xxs
yys, xxs = torch.meshgrid(
torch.arange(self.config.patch_size, device=device), torch.arange(self.config.patch_size, device=device)
)
indices[:, ..., 1] += yys
indices[:, ..., 2] += xxs
indices = torch.floor(indices).long()
indices = indices.flatten(0, 2)
indices = torch.floor(indices).long()
indices = indices.flatten(0, 2)
return indices