Unverified Commit 497c2df4 authored by Allan Zelener's avatar Allan Zelener Committed by GitHub
Browse files

[Fix] Add missing contiguous calls for nms_rotated (#2547)

Addresses issue https://github.com/open-mmlab/mmcv/issues/2542

For nms_rotated_cuda only adds contiguous call to dets_sorted which is accessed directly.
For nms_rotated_cpu the implementation now matches what's in the detectron2 repo.
parent 87768b7f
......@@ -26,8 +26,8 @@ Tensor nms_rotated(const Tensor dets, const Tensor scores, const Tensor order,
assert(dets.device().is_cuda() == scores.device().is_cuda());
if (dets.device().is_cuda()) {
#ifdef MMCV_WITH_CUDA
return nms_rotated_cuda(dets, scores, order, dets_sorted, iou_threshold,
multi_label);
return nms_rotated_cuda(dets, scores, order, dets_sorted.contiguous(),
iou_threshold, multi_label);
#else
AT_ERROR("Not compiled with GPU support");
#endif
......@@ -39,5 +39,5 @@ Tensor nms_rotated(const Tensor dets, const Tensor scores, const Tensor order,
#endif
}
return nms_rotated_cpu(dets, scores, iou_threshold);
return nms_rotated_cpu(dets.contiguous(), scores.contiguous(), iou_threshold);
}
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