PyTorch 1.6.0 compatability updates

This commit is contained in:
Glenn Jocher committed 2020-07-28 15:38:56 -07:00
1 parent 7f8471eaeb
commit 43a616a955
3 files changed
+7 -6

No files matched your search

+3 -3
View File
@@ -148,8 +148,8 @@ def test(data,
# Per target class
for cls in torch.unique(tcls_tensor):
ti = (cls == tcls_tensor).nonzero().view(-1) # prediction indices
pi = (cls == pred[:, 5]).nonzero().view(-1) # target indices
ti = (cls == tcls_tensor).nonzero(as_tuple=False).view(-1) # prediction indices
pi = (cls == pred[:, 5]).nonzero(as_tuple=False).view(-1) # target indices
# Search for detections
if pi.shape[0]:
@@ -157,7 +157,7 @@ def test(data,
ious, i = box_iou(pred[pi, :4], tbox[ti]).max(1) # best ious, indices
# Append detections
for j in (ious > iouv[0]).nonzero():
for j in (ious > iouv[0]).nonzero(as_tuple=False):
d = ti[i[j]] # detected target
if d not in detected:
detected.append(d)