developer0hye commited on
Commit
b46d3b4
·
1 Parent(s): 5b6dfa8

Skip to save unused tensor in dynamic_k_matching function (#304)

Browse files

Skip to save unused tensor in dynamic_k_matching function for saving memory usage

Files changed (1) hide show
  1. yolox/models/yolo_head.py +1 -1
yolox/models/yolo_head.py CHANGED
@@ -628,7 +628,7 @@ class YOLOXHead(nn.Module):
628
 
629
  anchor_matching_gt = matching_matrix.sum(0)
630
  if (anchor_matching_gt > 1).sum() > 0:
631
- cost_min, cost_argmin = torch.min(cost[:, anchor_matching_gt > 1], dim=0)
632
  matching_matrix[:, anchor_matching_gt > 1] *= 0.0
633
  matching_matrix[cost_argmin, anchor_matching_gt > 1] = 1.0
634
  fg_mask_inboxes = matching_matrix.sum(0) > 0.0
 
628
 
629
  anchor_matching_gt = matching_matrix.sum(0)
630
  if (anchor_matching_gt > 1).sum() > 0:
631
+ _, cost_argmin = torch.min(cost[:, anchor_matching_gt > 1], dim=0)
632
  matching_matrix[:, anchor_matching_gt > 1] *= 0.0
633
  matching_matrix[cost_argmin, anchor_matching_gt > 1] = 1.0
634
  fg_mask_inboxes = matching_matrix.sum(0) > 0.0