From 1198737c5a93bc0b062bd0552ac54f893bee05b8 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Tue, 14 Apr 2026 14:09:53 +0100 Subject: [PATCH] Deprecate quantized nms and roi_align --- torchvision/csrc/ops/quantized/cpu/qnms_kernel.cpp | 5 +++++ torchvision/csrc/ops/quantized/cpu/qroi_align_kernel.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/torchvision/csrc/ops/quantized/cpu/qnms_kernel.cpp b/torchvision/csrc/ops/quantized/cpu/qnms_kernel.cpp index fdcf21a2ae3..5493a2517b9 100644 --- a/torchvision/csrc/ops/quantized/cpu/qnms_kernel.cpp +++ b/torchvision/csrc/ops/quantized/cpu/qnms_kernel.cpp @@ -115,6 +115,11 @@ at::Tensor qnms_kernel( " and ", scores.size(0)); + TORCH_WARN_ONCE( + "Quantized NMS support is deprecated since torchvision 0.27 and will ", + "be removed in torchvision 0.28. Please dequantize your tensors before ", + "calling NMS."); + auto result = at::empty({0}); AT_DISPATCH_QINT_TYPES(dets.scalar_type(), "qnms_kernel", [&] { diff --git a/torchvision/csrc/ops/quantized/cpu/qroi_align_kernel.cpp b/torchvision/csrc/ops/quantized/cpu/qroi_align_kernel.cpp index c9097603f39..3a7ed01f833 100644 --- a/torchvision/csrc/ops/quantized/cpu/qroi_align_kernel.cpp +++ b/torchvision/csrc/ops/quantized/cpu/qroi_align_kernel.cpp @@ -243,6 +243,11 @@ at::Tensor qroi_align_forward_kernel( input.size(0) == 1, "Only one image per batch is allowed in roi_align when quantized tensors are passed."); + TORCH_WARN_ONCE( + "Quantized roi_align support is deprecated since torchvision 0.27 and ", + "will be removed in torchvision 0.28. Please dequantize your tensors ", + "before calling roi_align."); + at::TensorArg input_t{input, "input", 1}, rois_t{rois, "rois", 2}; at::CheckedFrom c = "qroi_align_forward_kernel";