Skip to content

Commit

Permalink
Add missing device info. (#3651)
Browse files Browse the repository at this point in the history
  • Loading branch information
datumbox authored Apr 8, 2021
1 parent ad9cc62 commit 07fb8ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion torchvision/models/detection/retinanet.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,8 @@ def compute_loss(self, targets, head_outputs, anchors):
matched_idxs = []
for anchors_per_image, targets_per_image in zip(anchors, targets):
if targets_per_image['boxes'].numel() == 0:
matched_idxs.append(torch.full((anchors_per_image.size(0),), -1, dtype=torch.int64))
matched_idxs.append(torch.full((anchors_per_image.size(0),), -1, dtype=torch.int64,
device=anchors_per_image.device))
continue

match_quality_matrix = box_ops.box_iou(targets_per_image['boxes'], anchors_per_image)
Expand Down

0 comments on commit 07fb8ba

Please sign in to comment.