Unverified Commit a50710aa authored by julienripoche's avatar julienripoche Committed by GitHub
Browse files

Change torch.arange dtype from torch.float32 to torch.int32 in anchor_utils.py (#4395) (#4409)


Co-authored-by: default avatarJulien RIPOCHE <ripoche@magic-lemp.com>
Co-authored-by: default avatarVasilis Vryniotis <datumbox@users.noreply.github.com>
parent c8e3b2a5
...@@ -97,10 +97,10 @@ class AnchorGenerator(nn.Module): ...@@ -97,10 +97,10 @@ class AnchorGenerator(nn.Module):
# For output anchor, compute [x_center, y_center, x_center, y_center] # For output anchor, compute [x_center, y_center, x_center, y_center]
shifts_x = torch.arange( shifts_x = torch.arange(
0, grid_width, dtype=torch.float32, device=device 0, grid_width, dtype=torch.int32, device=device
) * stride_width ) * stride_width
shifts_y = torch.arange( shifts_y = torch.arange(
0, grid_height, dtype=torch.float32, device=device 0, grid_height, dtype=torch.int32, device=device
) * stride_height ) * stride_height
shift_y, shift_x = torch.meshgrid(shifts_y, shifts_x) shift_y, shift_x = torch.meshgrid(shifts_y, shifts_x)
shift_x = shift_x.reshape(-1) shift_x = shift_x.reshape(-1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment