Skip to content

Commit a50710a

Browse files
julienripochejripochedatumbox
authored
Change torch.arange dtype from torch.float32 to torch.int32 in anchor_utils.py (#4395) (#4409)
Co-authored-by: Julien RIPOCHE <[email protected]> Co-authored-by: Vasilis Vryniotis <[email protected]>
1 parent c8e3b2a commit a50710a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torchvision/models/detection/anchor_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ def grid_anchors(self, grid_sizes: List[List[int]], strides: List[List[Tensor]])
9797

9898
# For output anchor, compute [x_center, y_center, x_center, y_center]
9999
shifts_x = torch.arange(
100-
0, grid_width, dtype=torch.float32, device=device
100+
0, grid_width, dtype=torch.int32, device=device
101101
) * stride_width
102102
shifts_y = torch.arange(
103-
0, grid_height, dtype=torch.float32, device=device
103+
0, grid_height, dtype=torch.int32, device=device
104104
) * stride_height
105105
shift_y, shift_x = torch.meshgrid(shifts_y, shifts_x)
106106
shift_x = shift_x.reshape(-1)

0 commit comments

Comments
 (0)