Unverified Commit a784db48 authored by Xu Zhao's avatar Xu Zhao Committed by GitHub
Browse files

Atttempt to reduce unnecessary cuda sync (#5515)


Co-authored-by: default avatarVasilis Vryniotis <datumbox@users.noreply.github.com>
parent e836b3d8
...@@ -121,8 +121,8 @@ class AnchorGenerator(nn.Module): ...@@ -121,8 +121,8 @@ class AnchorGenerator(nn.Module):
dtype, device = feature_maps[0].dtype, feature_maps[0].device dtype, device = feature_maps[0].dtype, feature_maps[0].device
strides = [ strides = [
[ [
torch.tensor(image_size[0] // g[0], dtype=torch.int64, device=device), torch.empty((), dtype=torch.int64, device=device).fill_(image_size[0] // g[0]),
torch.tensor(image_size[1] // g[1], dtype=torch.int64, device=device), torch.empty((), dtype=torch.int64, device=device).fill_(image_size[1] // g[1]),
] ]
for g in grid_sizes for g in grid_sizes
] ]
......
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