Skip to content

Commit

Permalink
Change dtype from torch.float32 to torch.int32 in anchor_utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqwang committed Sep 16, 2021
1 parent 992b8c3 commit 087d040
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yolort/models/anchor_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def grid_anchors(
grid_height, grid_width = size

# For output anchor, compute [x_center, y_center, x_center, y_center]
shifts_x = torch.arange(0, grid_width, dtype=torch.float32, device=device).to(dtype=dtype)
shifts_y = torch.arange(0, grid_height, dtype=torch.float32, device=device).to(dtype=dtype)
shifts_x = torch.arange(0, grid_width, dtype=torch.int32, device=device).to(dtype=dtype)
shifts_y = torch.arange(0, grid_height, dtype=torch.int32, device=device).to(dtype=dtype)

shift_y, shift_x = torch.meshgrid(shifts_y, shifts_x)

Expand Down

0 comments on commit 087d040

Please sign in to comment.