Unverified Commit 3c2c0022 authored by gslotman's avatar gslotman Committed by GitHub
Browse files

Fix some deprecated warnings (#2055)

parent d0b32a11
......@@ -5,10 +5,10 @@ at::Tensor nms_cpu_kernel(
const at::Tensor& dets,
const at::Tensor& scores,
const float iou_threshold) {
AT_ASSERTM(!dets.type().is_cuda(), "dets must be a CPU tensor");
AT_ASSERTM(!scores.type().is_cuda(), "scores must be a CPU tensor");
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.type() == scores.type(), "dets should have the same type as scores");
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));
......@@ -74,7 +74,7 @@ at::Tensor nms_cpu(
const float iou_threshold) {
auto result = at::empty({0}, dets.options());
AT_DISPATCH_FLOATING_TYPES(dets.type(), "nms", [&] {
AT_DISPATCH_FLOATING_TYPES(dets.scalar_type(), "nms", [&] {
result = nms_cpu_kernel<scalar_t>(dets, scores, iou_threshold);
});
return result;
......
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