Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions torchvision/csrc/cpu/nms_cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ at::Tensor nms_cpu_kernel(
const at::Tensor& scores,
const float iou_threshold) {
AT_ASSERTM(!dets.options().device().is_cuda(), "dets must be a CPU tensor");
AT_ASSERTM(!scores.options().device().is_cuda(), "scores must be a CPU tensor");
AT_ASSERTM(
dets.scalar_type() == scores.scalar_type(), "dets should have the same type as scores");
!scores.options().device().is_cuda(), "scores must be a CPU tensor");
AT_ASSERTM(
dets.scalar_type() == scores.scalar_type(),
"dets should have the same type as scores");

if (dets.numel() == 0)
return at::empty({0}, dets.options().dtype(at::kLong));
Expand Down