Skip to content

Commit

Permalink
forgot import bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sutt committed Feb 11, 2020
1 parent ca28ecd commit 5e875c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Computer Vision/imports/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def create_grid(size):
"Create a grid of a given `size`."
H, W = size
grid = FloatTensor(H, W, 2)
linear_points = torch.linspace(-1+1/W, 1-1/W, W) if W > 1 else tensor([0.])
linear_points = torch.linspace(-1+1/W, 1-1/W, W) if W > 1 else torch.tensor([0.])
grid[:, :, 1] = torch.ger(torch.ones(H), linear_points).expand_as(grid[:, :, 0])
linear_points = torch.linspace(-1+1/H, 1-1/H, H) if H > 1 else tensor([0.])
linear_points = torch.linspace(-1+1/H, 1-1/H, H) if H > 1 else torch.tensor([0.])
grid[:, :, 0] = torch.ger(linear_points, torch.ones(W)).expand_as(grid[:, :, 1])
return grid.view(-1,2)

Expand Down

0 comments on commit 5e875c9

Please sign in to comment.