From 087d0406c441da44037813063c3ed9e510c83c8a Mon Sep 17 00:00:00 2001 From: Zhiqiang Wang Date: Thu, 16 Sep 2021 05:42:17 -0400 Subject: [PATCH] Change dtype from torch.float32 to torch.int32 in anchor_utils.py --- yolort/models/anchor_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yolort/models/anchor_utils.py b/yolort/models/anchor_utils.py index afb86453..0f0e3475 100644 --- a/yolort/models/anchor_utils.py +++ b/yolort/models/anchor_utils.py @@ -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)