Skip to content

Commit

Permalink
Merge pull request #4 from Skydes/bug-fix.
Browse files Browse the repository at this point in the history
Replace view by reshape to force contiguity.
  • Loading branch information
mihaidusmanu authored Mar 8, 2021
2 parents d7766e4 + a4630e4 commit 2e28c18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion two-view-refinement/refinement.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def extract_patches(image, ij, device, patch_size=33):
full_ij = norm_ij.view(-1, 1, 1, 2) + grid_patch

patches = F.grid_sample(
image.unsqueeze(0), full_ij[:, :, :, [1, 0]].view(1, -1, patch_size, 2),
image.unsqueeze(0), full_ij[:, :, :, [1, 0]].reshape(1, -1, patch_size, 2),
padding_mode='reflection', align_corners=True
).squeeze(0)
patches = patches.view(c, -1, patch_size, patch_size).permute([1, 0, 2, 3])
Expand Down

0 comments on commit 2e28c18

Please sign in to comment.