From f377dded567779f435319b80b1e06d745d293308 Mon Sep 17 00:00:00 2001 From: Vasilis Vryniotis Date: Mon, 4 Jan 2021 16:01:52 +0000 Subject: [PATCH 1/2] Adding TORCH_SELECTIVE_* macros on op registration. --- torchvision/csrc/ops/autocast/deform_conv2d_kernel.cpp | 3 ++- torchvision/csrc/ops/autocast/nms_kernel.cpp | 2 +- torchvision/csrc/ops/autocast/ps_roi_align_kernel.cpp | 2 +- torchvision/csrc/ops/autocast/ps_roi_pool_kernel.cpp | 2 +- torchvision/csrc/ops/autocast/roi_align_kernel.cpp | 2 +- torchvision/csrc/ops/autocast/roi_pool_kernel.cpp | 2 +- torchvision/csrc/ops/autograd/deform_conv2d_kernel.cpp | 7 +++++-- torchvision/csrc/ops/autograd/ps_roi_align_kernel.cpp | 6 ++++-- torchvision/csrc/ops/autograd/ps_roi_pool_kernel.cpp | 6 ++++-- torchvision/csrc/ops/autograd/roi_align_kernel.cpp | 6 ++++-- torchvision/csrc/ops/autograd/roi_pool_kernel.cpp | 6 ++++-- torchvision/csrc/ops/cpu/deform_conv2d_kernel.cpp | 8 ++++++-- torchvision/csrc/ops/cpu/nms_kernel.cpp | 2 +- torchvision/csrc/ops/cpu/ps_roi_align_kernel.cpp | 8 ++++++-- torchvision/csrc/ops/cpu/ps_roi_pool_kernel.cpp | 8 ++++++-- torchvision/csrc/ops/cpu/roi_align_kernel.cpp | 6 ++++-- torchvision/csrc/ops/cpu/roi_pool_kernel.cpp | 6 ++++-- torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu | 8 ++++++-- torchvision/csrc/ops/cuda/nms_kernel.cu | 2 +- torchvision/csrc/ops/cuda/ps_roi_align_kernel.cu | 8 ++++++-- torchvision/csrc/ops/cuda/ps_roi_pool_kernel.cu | 8 ++++++-- torchvision/csrc/ops/cuda/roi_align_kernel.cu | 6 ++++-- torchvision/csrc/ops/cuda/roi_pool_kernel.cu | 6 ++++-- torchvision/csrc/ops/deform_conv2d.cpp | 8 ++++---- torchvision/csrc/ops/nms.cpp | 3 ++- torchvision/csrc/ops/ps_roi_align.cpp | 8 ++++---- torchvision/csrc/ops/ps_roi_pool.cpp | 8 ++++---- torchvision/csrc/ops/roi_align.cpp | 8 ++++---- torchvision/csrc/ops/roi_pool.cpp | 8 ++++---- 29 files changed, 104 insertions(+), 59 deletions(-) diff --git a/torchvision/csrc/ops/autocast/deform_conv2d_kernel.cpp b/torchvision/csrc/ops/autocast/deform_conv2d_kernel.cpp index f86e3d31057..f9cbf97e4de 100644 --- a/torchvision/csrc/ops/autocast/deform_conv2d_kernel.cpp +++ b/torchvision/csrc/ops/autocast/deform_conv2d_kernel.cpp @@ -45,7 +45,8 @@ at::Tensor deform_conv2d_autocast( } // namespace TORCH_LIBRARY_IMPL(torchvision, Autocast, m) { - m.impl("deform_conv2d", deform_conv2d_autocast); + m.impl( + TORCH_SELECTIVE_NAME("deform_conv2d"), TORCH_FN(deform_conv2d_autocast)); } } // namespace ops diff --git a/torchvision/csrc/ops/autocast/nms_kernel.cpp b/torchvision/csrc/ops/autocast/nms_kernel.cpp index 33cd9f1077e..9a35e380298 100644 --- a/torchvision/csrc/ops/autocast/nms_kernel.cpp +++ b/torchvision/csrc/ops/autocast/nms_kernel.cpp @@ -22,7 +22,7 @@ at::Tensor nms_autocast( } // namespace TORCH_LIBRARY_IMPL(torchvision, Autocast, m) { - m.impl("nms", nms_autocast); + m.impl(TORCH_SELECTIVE_NAME("nms"), TORCH_FN(nms_autocast)); } } // namespace ops diff --git a/torchvision/csrc/ops/autocast/ps_roi_align_kernel.cpp b/torchvision/csrc/ops/autocast/ps_roi_align_kernel.cpp index b59417da544..a4b39f03a10 100644 --- a/torchvision/csrc/ops/autocast/ps_roi_align_kernel.cpp +++ b/torchvision/csrc/ops/autocast/ps_roi_align_kernel.cpp @@ -32,7 +32,7 @@ std::tuple ps_roi_align_autocast( } // namespace TORCH_LIBRARY_IMPL(torchvision, Autocast, m) { - m.impl("ps_roi_align", ps_roi_align_autocast); + m.impl(TORCH_SELECTIVE_NAME("ps_roi_align"), TORCH_FN(ps_roi_align_autocast)); } } // namespace ops diff --git a/torchvision/csrc/ops/autocast/ps_roi_pool_kernel.cpp b/torchvision/csrc/ops/autocast/ps_roi_pool_kernel.cpp index 026a53a49da..76232c60803 100644 --- a/torchvision/csrc/ops/autocast/ps_roi_pool_kernel.cpp +++ b/torchvision/csrc/ops/autocast/ps_roi_pool_kernel.cpp @@ -30,7 +30,7 @@ std::tuple ps_roi_pool_autocast( } // namespace TORCH_LIBRARY_IMPL(torchvision, Autocast, m) { - m.impl("ps_roi_pool", ps_roi_pool_autocast); + m.impl(TORCH_SELECTIVE_NAME("ps_roi_pool"), TORCH_FN(ps_roi_pool_autocast)); } } // namespace ops diff --git a/torchvision/csrc/ops/autocast/roi_align_kernel.cpp b/torchvision/csrc/ops/autocast/roi_align_kernel.cpp index 313753d9a3f..d9174f1f53c 100644 --- a/torchvision/csrc/ops/autocast/roi_align_kernel.cpp +++ b/torchvision/csrc/ops/autocast/roi_align_kernel.cpp @@ -31,7 +31,7 @@ at::Tensor roi_align_autocast( } // namespace TORCH_LIBRARY_IMPL(torchvision, Autocast, m) { - m.impl("roi_align", roi_align_autocast); + m.impl(TORCH_SELECTIVE_NAME("roi_align"), TORCH_FN(roi_align_autocast)); } } // namespace ops diff --git a/torchvision/csrc/ops/autocast/roi_pool_kernel.cpp b/torchvision/csrc/ops/autocast/roi_pool_kernel.cpp index 4f9cf6bdfc9..247492b2641 100644 --- a/torchvision/csrc/ops/autocast/roi_pool_kernel.cpp +++ b/torchvision/csrc/ops/autocast/roi_pool_kernel.cpp @@ -30,7 +30,7 @@ std::tuple roi_pool_autocast( } // namespace TORCH_LIBRARY_IMPL(torchvision, Autocast, m) { - m.impl("roi_pool", roi_pool_autocast); + m.impl(TORCH_SELECTIVE_NAME("roi_pool"), TORCH_FN(roi_pool_autocast)); } } // namespace ops diff --git a/torchvision/csrc/ops/autograd/deform_conv2d_kernel.cpp b/torchvision/csrc/ops/autograd/deform_conv2d_kernel.cpp index 54d1512f3e8..6de1c86522d 100644 --- a/torchvision/csrc/ops/autograd/deform_conv2d_kernel.cpp +++ b/torchvision/csrc/ops/autograd/deform_conv2d_kernel.cpp @@ -254,8 +254,11 @@ deform_conv2d_backward_autograd( } // namespace TORCH_LIBRARY_IMPL(torchvision, Autograd, m) { - m.impl("deform_conv2d", deform_conv2d_autograd); - m.impl("_deform_conv2d_backward", deform_conv2d_backward_autograd); + m.impl( + TORCH_SELECTIVE_NAME("deform_conv2d"), TORCH_FN(deform_conv2d_autograd)); + m.impl( + TORCH_SELECTIVE_NAME("_deform_conv2d_backward"), + TORCH_FN(deform_conv2d_backward_autograd)); } } // namespace ops diff --git a/torchvision/csrc/ops/autograd/ps_roi_align_kernel.cpp b/torchvision/csrc/ops/autograd/ps_roi_align_kernel.cpp index 7fe215112d1..3cab1464a5a 100644 --- a/torchvision/csrc/ops/autograd/ps_roi_align_kernel.cpp +++ b/torchvision/csrc/ops/autograd/ps_roi_align_kernel.cpp @@ -154,8 +154,10 @@ at::Tensor ps_roi_align_backward_autograd( } // namespace TORCH_LIBRARY_IMPL(torchvision, Autograd, m) { - m.impl("ps_roi_align", ps_roi_align_autograd); - m.impl("_ps_roi_align_backward", ps_roi_align_backward_autograd); + m.impl(TORCH_SELECTIVE_NAME("ps_roi_align"), TORCH_FN(ps_roi_align_autograd)); + m.impl( + TORCH_SELECTIVE_NAME("_ps_roi_align_backward"), + TORCH_FN(ps_roi_align_backward_autograd)); } } // namespace ops diff --git a/torchvision/csrc/ops/autograd/ps_roi_pool_kernel.cpp b/torchvision/csrc/ops/autograd/ps_roi_pool_kernel.cpp index 89891e03c1b..6f6e36ce33e 100644 --- a/torchvision/csrc/ops/autograd/ps_roi_pool_kernel.cpp +++ b/torchvision/csrc/ops/autograd/ps_roi_pool_kernel.cpp @@ -139,8 +139,10 @@ at::Tensor ps_roi_pool_backward_autograd( } // namespace TORCH_LIBRARY_IMPL(torchvision, Autograd, m) { - m.impl("ps_roi_pool", ps_roi_pool_autograd); - m.impl("_ps_roi_pool_backward", ps_roi_pool_backward_autograd); + m.impl(TORCH_SELECTIVE_NAME("ps_roi_pool"), TORCH_FN(ps_roi_pool_autograd)); + m.impl( + TORCH_SELECTIVE_NAME("_ps_roi_pool_backward"), + TORCH_FN(ps_roi_pool_backward_autograd)); } } // namespace ops diff --git a/torchvision/csrc/ops/autograd/roi_align_kernel.cpp b/torchvision/csrc/ops/autograd/roi_align_kernel.cpp index 751ee0cd64f..c3b6fed6220 100644 --- a/torchvision/csrc/ops/autograd/roi_align_kernel.cpp +++ b/torchvision/csrc/ops/autograd/roi_align_kernel.cpp @@ -154,8 +154,10 @@ at::Tensor roi_align_backward_autograd( } // namespace TORCH_LIBRARY_IMPL(torchvision, Autograd, m) { - m.impl("roi_align", roi_align_autograd); - m.impl("_roi_align_backward", roi_align_backward_autograd); + m.impl(TORCH_SELECTIVE_NAME("roi_align"), TORCH_FN(roi_align_autograd)); + m.impl( + TORCH_SELECTIVE_NAME("_roi_align_backward"), + TORCH_FN(roi_align_backward_autograd)); } } // namespace ops diff --git a/torchvision/csrc/ops/autograd/roi_pool_kernel.cpp b/torchvision/csrc/ops/autograd/roi_pool_kernel.cpp index e6f9b23ddfb..e396ff26992 100644 --- a/torchvision/csrc/ops/autograd/roi_pool_kernel.cpp +++ b/torchvision/csrc/ops/autograd/roi_pool_kernel.cpp @@ -139,8 +139,10 @@ at::Tensor roi_pool_backward_autograd( } // namespace TORCH_LIBRARY_IMPL(torchvision, Autograd, m) { - m.impl("roi_pool", roi_pool_autograd); - m.impl("_roi_pool_backward", roi_pool_backward_autograd); + m.impl(TORCH_SELECTIVE_NAME("roi_pool"), TORCH_FN(roi_pool_autograd)); + m.impl( + TORCH_SELECTIVE_NAME("_roi_pool_backward"), + TORCH_FN(roi_pool_backward_autograd)); } } // namespace ops diff --git a/torchvision/csrc/ops/cpu/deform_conv2d_kernel.cpp b/torchvision/csrc/ops/cpu/deform_conv2d_kernel.cpp index d3f04cafae8..61066152468 100644 --- a/torchvision/csrc/ops/cpu/deform_conv2d_kernel.cpp +++ b/torchvision/csrc/ops/cpu/deform_conv2d_kernel.cpp @@ -1143,8 +1143,12 @@ deform_conv2d_backward_kernel( } // namespace TORCH_LIBRARY_IMPL(torchvision, CPU, m) { - m.impl("deform_conv2d", deform_conv2d_forward_kernel); - m.impl("_deform_conv2d_backward", deform_conv2d_backward_kernel); + m.impl( + TORCH_SELECTIVE_NAME("deform_conv2d"), + TORCH_FN(deform_conv2d_forward_kernel)); + m.impl( + TORCH_SELECTIVE_NAME("_deform_conv2d_backward"), + TORCH_FN(deform_conv2d_backward_kernel)); } } // namespace ops diff --git a/torchvision/csrc/ops/cpu/nms_kernel.cpp b/torchvision/csrc/ops/cpu/nms_kernel.cpp index 1bd64b10296..53f77790614 100644 --- a/torchvision/csrc/ops/cpu/nms_kernel.cpp +++ b/torchvision/csrc/ops/cpu/nms_kernel.cpp @@ -109,7 +109,7 @@ at::Tensor nms_kernel( } // namespace TORCH_LIBRARY_IMPL(torchvision, CPU, m) { - m.impl("nms", nms_kernel); + m.impl(TORCH_SELECTIVE_NAME("nms"), TORCH_FN(nms_kernel)); } } // namespace ops diff --git a/torchvision/csrc/ops/cpu/ps_roi_align_kernel.cpp b/torchvision/csrc/ops/cpu/ps_roi_align_kernel.cpp index 5c4f978ae87..90f60cc560b 100644 --- a/torchvision/csrc/ops/cpu/ps_roi_align_kernel.cpp +++ b/torchvision/csrc/ops/cpu/ps_roi_align_kernel.cpp @@ -422,8 +422,12 @@ at::Tensor ps_roi_align_backward_kernel( } // namespace TORCH_LIBRARY_IMPL(torchvision, CPU, m) { - m.impl("ps_roi_align", ps_roi_align_forward_kernel); - m.impl("_ps_roi_align_backward", ps_roi_align_backward_kernel); + m.impl( + TORCH_SELECTIVE_NAME("ps_roi_align"), + TORCH_FN(ps_roi_align_forward_kernel)); + m.impl( + TORCH_SELECTIVE_NAME("_ps_roi_align_backward"), + TORCH_FN(ps_roi_align_backward_kernel)); } } // namespace ops diff --git a/torchvision/csrc/ops/cpu/ps_roi_pool_kernel.cpp b/torchvision/csrc/ops/cpu/ps_roi_pool_kernel.cpp index e20c20869f2..bbd15f7de7c 100644 --- a/torchvision/csrc/ops/cpu/ps_roi_pool_kernel.cpp +++ b/torchvision/csrc/ops/cpu/ps_roi_pool_kernel.cpp @@ -261,8 +261,12 @@ at::Tensor ps_roi_pool_backward_kernel( } // namespace TORCH_LIBRARY_IMPL(torchvision, CPU, m) { - m.impl("ps_roi_pool", ps_roi_pool_forward_kernel); - m.impl("_ps_roi_pool_backward", ps_roi_pool_backward_kernel); + m.impl( + TORCH_SELECTIVE_NAME("ps_roi_pool"), + TORCH_FN(ps_roi_pool_forward_kernel)); + m.impl( + TORCH_SELECTIVE_NAME("_ps_roi_pool_backward"), + TORCH_FN(ps_roi_pool_backward_kernel)); } } // namespace ops diff --git a/torchvision/csrc/ops/cpu/roi_align_kernel.cpp b/torchvision/csrc/ops/cpu/roi_align_kernel.cpp index 6b6f36d7d7a..2efd4e3ffaa 100644 --- a/torchvision/csrc/ops/cpu/roi_align_kernel.cpp +++ b/torchvision/csrc/ops/cpu/roi_align_kernel.cpp @@ -500,8 +500,10 @@ at::Tensor roi_align_backward_kernel( } // namespace TORCH_LIBRARY_IMPL(torchvision, CPU, m) { - m.impl("roi_align", roi_align_forward_kernel); - m.impl("_roi_align_backward", roi_align_backward_kernel); + m.impl(TORCH_SELECTIVE_NAME("roi_align"), TORCH_FN(roi_align_forward_kernel)); + m.impl( + TORCH_SELECTIVE_NAME("_roi_align_backward"), + TORCH_FN(roi_align_backward_kernel)); } } // namespace ops diff --git a/torchvision/csrc/ops/cpu/roi_pool_kernel.cpp b/torchvision/csrc/ops/cpu/roi_pool_kernel.cpp index c600778e16e..fd5db83ca14 100644 --- a/torchvision/csrc/ops/cpu/roi_pool_kernel.cpp +++ b/torchvision/csrc/ops/cpu/roi_pool_kernel.cpp @@ -237,8 +237,10 @@ at::Tensor roi_pool_backward_kernel( } // namespace TORCH_LIBRARY_IMPL(torchvision, CPU, m) { - m.impl("roi_pool", roi_pool_forward_kernel); - m.impl("_roi_pool_backward", roi_pool_backward_kernel); + m.impl(TORCH_SELECTIVE_NAME("roi_pool"), TORCH_FN(roi_pool_forward_kernel)); + m.impl( + TORCH_SELECTIVE_NAME("_roi_pool_backward"), + TORCH_FN(roi_pool_backward_kernel)); } } // namespace ops diff --git a/torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu b/torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu index 99ccf9133fd..410f87da219 100644 --- a/torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu +++ b/torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu @@ -1189,8 +1189,12 @@ deform_conv2d_backward_kernel( } // namespace TORCH_LIBRARY_IMPL(torchvision, CUDA, m) { - m.impl("deform_conv2d", deform_conv2d_forward_kernel); - m.impl("_deform_conv2d_backward", deform_conv2d_backward_kernel); + m.impl( + TORCH_SELECTIVE_NAME("deform_conv2d"), + TORCH_FN(deform_conv2d_forward_kernel)); + m.impl( + TORCH_SELECTIVE_NAME("_deform_conv2d_backward"), + TORCH_FN(deform_conv2d_backward_kernel)); } } // namespace ops diff --git a/torchvision/csrc/ops/cuda/nms_kernel.cu b/torchvision/csrc/ops/cuda/nms_kernel.cu index 024509727a4..662dbda78b7 100644 --- a/torchvision/csrc/ops/cuda/nms_kernel.cu +++ b/torchvision/csrc/ops/cuda/nms_kernel.cu @@ -168,7 +168,7 @@ at::Tensor nms_kernel( } // namespace TORCH_LIBRARY_IMPL(torchvision, CUDA, m) { - m.impl("nms", nms_kernel); + m.impl(TORCH_SELECTIVE_NAME("nms"), TORCH_FN(nms_kernel)); } } // namespace ops diff --git a/torchvision/csrc/ops/cuda/ps_roi_align_kernel.cu b/torchvision/csrc/ops/cuda/ps_roi_align_kernel.cu index d001a74e38d..5c69da354a4 100644 --- a/torchvision/csrc/ops/cuda/ps_roi_align_kernel.cu +++ b/torchvision/csrc/ops/cuda/ps_roi_align_kernel.cu @@ -440,8 +440,12 @@ at::Tensor ps_roi_align_backward_kernel( } // namespace TORCH_LIBRARY_IMPL(torchvision, CUDA, m) { - m.impl("ps_roi_align", ps_roi_align_forward_kernel); - m.impl("_ps_roi_align_backward", ps_roi_align_backward_kernel); + m.impl( + TORCH_SELECTIVE_NAME("ps_roi_align"), + TORCH_FN(ps_roi_align_forward_kernel)); + m.impl( + TORCH_SELECTIVE_NAME("_ps_roi_align_backward"), + TORCH_FN(ps_roi_align_backward_kernel)); } } // namespace ops diff --git a/torchvision/csrc/ops/cuda/ps_roi_pool_kernel.cu b/torchvision/csrc/ops/cuda/ps_roi_pool_kernel.cu index 441c202fa2c..1094f167757 100644 --- a/torchvision/csrc/ops/cuda/ps_roi_pool_kernel.cu +++ b/torchvision/csrc/ops/cuda/ps_roi_pool_kernel.cu @@ -276,8 +276,12 @@ at::Tensor ps_roi_pool_backward_kernel( } // namespace TORCH_LIBRARY_IMPL(torchvision, CUDA, m) { - m.impl("ps_roi_pool", ps_roi_pool_forward_kernel); - m.impl("_ps_roi_pool_backward", ps_roi_pool_backward_kernel); + m.impl( + TORCH_SELECTIVE_NAME("ps_roi_pool"), + TORCH_FN(ps_roi_pool_forward_kernel)); + m.impl( + TORCH_SELECTIVE_NAME("_ps_roi_pool_backward"), + TORCH_FN(ps_roi_pool_backward_kernel)); } } // namespace ops diff --git a/torchvision/csrc/ops/cuda/roi_align_kernel.cu b/torchvision/csrc/ops/cuda/roi_align_kernel.cu index 0930e4fbf44..4dd8faa97e7 100644 --- a/torchvision/csrc/ops/cuda/roi_align_kernel.cu +++ b/torchvision/csrc/ops/cuda/roi_align_kernel.cu @@ -449,8 +449,10 @@ at::Tensor roi_align_backward_kernel( } // namespace TORCH_LIBRARY_IMPL(torchvision, CUDA, m) { - m.impl("roi_align", roi_align_forward_kernel); - m.impl("_roi_align_backward", roi_align_backward_kernel); + m.impl(TORCH_SELECTIVE_NAME("roi_align"), TORCH_FN(roi_align_forward_kernel)); + m.impl( + TORCH_SELECTIVE_NAME("_roi_align_backward"), + TORCH_FN(roi_align_backward_kernel)); } } // namespace ops diff --git a/torchvision/csrc/ops/cuda/roi_pool_kernel.cu b/torchvision/csrc/ops/cuda/roi_pool_kernel.cu index 6084e492903..50d167e0591 100644 --- a/torchvision/csrc/ops/cuda/roi_pool_kernel.cu +++ b/torchvision/csrc/ops/cuda/roi_pool_kernel.cu @@ -260,8 +260,10 @@ at::Tensor roi_pool_backward_kernel( } // namespace TORCH_LIBRARY_IMPL(torchvision, CUDA, m) { - m.impl("roi_pool", roi_pool_forward_kernel); - m.impl("_roi_pool_backward", roi_pool_backward_kernel); + m.impl(TORCH_SELECTIVE_NAME("roi_pool"), TORCH_FN(roi_pool_forward_kernel)); + m.impl( + TORCH_SELECTIVE_NAME("_roi_pool_backward"), + TORCH_FN(roi_pool_backward_kernel)); } } // namespace ops diff --git a/torchvision/csrc/ops/deform_conv2d.cpp b/torchvision/csrc/ops/deform_conv2d.cpp index 44870845bd4..a19a8ca495a 100644 --- a/torchvision/csrc/ops/deform_conv2d.cpp +++ b/torchvision/csrc/ops/deform_conv2d.cpp @@ -84,10 +84,10 @@ _deform_conv2d_backward( } // namespace detail TORCH_LIBRARY_FRAGMENT(torchvision, m) { - m.def( - "deform_conv2d(Tensor input, Tensor weight, Tensor offset, Tensor mask, Tensor bias, int stride_h, int stride_w, int pad_h, int pad_w, int dilation_h, int dilation_w, int groups, int offset_groups, bool use_mask) -> Tensor"); - m.def( - "_deform_conv2d_backward(Tensor grad, Tensor input, Tensor weight, Tensor offset, Tensor mask, Tensor bias, int stride_h, int stride_w, int pad_h, int pad_w, int dilation_h, int dilation_w, int groups, int offset_groups, bool use_mask) -> (Tensor, Tensor, Tensor, Tensor, Tensor)"); + m.def(TORCH_SELECTIVE_SCHEMA( + "deform_conv2d(Tensor input, Tensor weight, Tensor offset, Tensor mask, Tensor bias, int stride_h, int stride_w, int pad_h, int pad_w, int dilation_h, int dilation_w, int groups, int offset_groups, bool use_mask) -> Tensor")); + m.def(TORCH_SELECTIVE_SCHEMA( + "_deform_conv2d_backward(Tensor grad, Tensor input, Tensor weight, Tensor offset, Tensor mask, Tensor bias, int stride_h, int stride_w, int pad_h, int pad_w, int dilation_h, int dilation_w, int groups, int offset_groups, bool use_mask) -> (Tensor, Tensor, Tensor, Tensor, Tensor)")); } } // namespace ops diff --git a/torchvision/csrc/ops/nms.cpp b/torchvision/csrc/ops/nms.cpp index 8c2455f1142..96674aea5c5 100644 --- a/torchvision/csrc/ops/nms.cpp +++ b/torchvision/csrc/ops/nms.cpp @@ -16,7 +16,8 @@ at::Tensor nms( } TORCH_LIBRARY_FRAGMENT(torchvision, m) { - m.def("nms(Tensor dets, Tensor scores, float iou_threshold) -> Tensor"); + m.def(TORCH_SELECTIVE_SCHEMA( + "nms(Tensor dets, Tensor scores, float iou_threshold) -> Tensor")); } } // namespace ops diff --git a/torchvision/csrc/ops/ps_roi_align.cpp b/torchvision/csrc/ops/ps_roi_align.cpp index 53925e6f2ed..914b731c7b1 100644 --- a/torchvision/csrc/ops/ps_roi_align.cpp +++ b/torchvision/csrc/ops/ps_roi_align.cpp @@ -54,10 +54,10 @@ at::Tensor _ps_roi_align_backward( } // namespace detail TORCH_LIBRARY_FRAGMENT(torchvision, m) { - m.def( - "ps_roi_align(Tensor input, Tensor rois, float spatial_scale, int pooled_height, int pooled_width, int sampling_ratio) -> (Tensor, Tensor)"); - m.def( - "_ps_roi_align_backward(Tensor grad, Tensor rois, Tensor channel_mapping, float spatial_scale, int pooled_height, int pooled_width, int sampling_ratio, int batch_size, int channels, int height, int width) -> Tensor"); + m.def(TORCH_SELECTIVE_SCHEMA( + "ps_roi_align(Tensor input, Tensor rois, float spatial_scale, int pooled_height, int pooled_width, int sampling_ratio) -> (Tensor, Tensor)")); + m.def(TORCH_SELECTIVE_SCHEMA( + "_ps_roi_align_backward(Tensor grad, Tensor rois, Tensor channel_mapping, float spatial_scale, int pooled_height, int pooled_width, int sampling_ratio, int batch_size, int channels, int height, int width) -> Tensor")); } } // namespace ops diff --git a/torchvision/csrc/ops/ps_roi_pool.cpp b/torchvision/csrc/ops/ps_roi_pool.cpp index 1bc7df233d1..10b79e02b3c 100644 --- a/torchvision/csrc/ops/ps_roi_pool.cpp +++ b/torchvision/csrc/ops/ps_roi_pool.cpp @@ -50,10 +50,10 @@ at::Tensor _ps_roi_pool_backward( } // namespace detail TORCH_LIBRARY_FRAGMENT(torchvision, m) { - m.def( - "ps_roi_pool(Tensor input, Tensor rois, float spatial_scale, int pooled_height, int pooled_width) -> (Tensor, Tensor)"); - m.def( - "_ps_roi_pool_backward(Tensor grad, Tensor rois, Tensor channel_mapping, float spatial_scale, int pooled_height, int pooled_width, int batch_size, int channels, int height, int width) -> Tensor"); + m.def(TORCH_SELECTIVE_SCHEMA( + "ps_roi_pool(Tensor input, Tensor rois, float spatial_scale, int pooled_height, int pooled_width) -> (Tensor, Tensor)")); + m.def(TORCH_SELECTIVE_SCHEMA( + "_ps_roi_pool_backward(Tensor grad, Tensor rois, Tensor channel_mapping, float spatial_scale, int pooled_height, int pooled_width, int batch_size, int channels, int height, int width) -> Tensor")); } } // namespace ops diff --git a/torchvision/csrc/ops/roi_align.cpp b/torchvision/csrc/ops/roi_align.cpp index c4b0cc0167d..8ba35a4a71e 100644 --- a/torchvision/csrc/ops/roi_align.cpp +++ b/torchvision/csrc/ops/roi_align.cpp @@ -64,10 +64,10 @@ at::Tensor _roi_align_backward( } // namespace detail TORCH_LIBRARY_FRAGMENT(torchvision, m) { - m.def( - "roi_align(Tensor input, Tensor rois, float spatial_scale, int pooled_height, int pooled_width, int sampling_ratio, bool aligned) -> Tensor"); - m.def( - "_roi_align_backward(Tensor grad, Tensor rois, float spatial_scale, int pooled_height, int pooled_width, int batch_size, int channels, int height, int width, int sampling_ratio, bool aligned) -> Tensor"); + m.def(TORCH_SELECTIVE_SCHEMA( + "roi_align(Tensor input, Tensor rois, float spatial_scale, int pooled_height, int pooled_width, int sampling_ratio, bool aligned) -> Tensor")); + m.def(TORCH_SELECTIVE_SCHEMA( + "_roi_align_backward(Tensor grad, Tensor rois, float spatial_scale, int pooled_height, int pooled_width, int batch_size, int channels, int height, int width, int sampling_ratio, bool aligned) -> Tensor")); } } // namespace ops diff --git a/torchvision/csrc/ops/roi_pool.cpp b/torchvision/csrc/ops/roi_pool.cpp index c2fcb459e3f..8240c8501ad 100644 --- a/torchvision/csrc/ops/roi_pool.cpp +++ b/torchvision/csrc/ops/roi_pool.cpp @@ -49,10 +49,10 @@ at::Tensor _roi_pool_backward( } // namespace detail TORCH_LIBRARY_FRAGMENT(torchvision, m) { - m.def( - "roi_pool(Tensor input, Tensor rois, float spatial_scale, int pooled_height, int pooled_width) -> (Tensor, Tensor)"); - m.def( - "_roi_pool_backward(Tensor grad, Tensor rois, Tensor argmax, float spatial_scale, int pooled_height, int pooled_width, int batch_size, int channels, int height, int width) -> Tensor"); + m.def(TORCH_SELECTIVE_SCHEMA( + "roi_pool(Tensor input, Tensor rois, float spatial_scale, int pooled_height, int pooled_width) -> (Tensor, Tensor)")); + m.def(TORCH_SELECTIVE_SCHEMA( + "_roi_pool_backward(Tensor grad, Tensor rois, Tensor argmax, float spatial_scale, int pooled_height, int pooled_width, int batch_size, int channels, int height, int width) -> Tensor")); } } // namespace ops From e26330b58d1351dc29f608a5c6f36f2a48f0e8e1 Mon Sep 17 00:00:00 2001 From: Vasilis Vryniotis Date: Mon, 4 Jan 2021 17:10:42 +0000 Subject: [PATCH 2/2] Adding torchvision namespace. --- torchvision/csrc/ops/autocast/deform_conv2d_kernel.cpp | 3 ++- torchvision/csrc/ops/autocast/nms_kernel.cpp | 2 +- torchvision/csrc/ops/autocast/ps_roi_align_kernel.cpp | 4 +++- torchvision/csrc/ops/autocast/ps_roi_pool_kernel.cpp | 4 +++- torchvision/csrc/ops/autocast/roi_align_kernel.cpp | 4 +++- torchvision/csrc/ops/autocast/roi_pool_kernel.cpp | 4 +++- torchvision/csrc/ops/autograd/deform_conv2d_kernel.cpp | 5 +++-- torchvision/csrc/ops/autograd/ps_roi_align_kernel.cpp | 6 ++++-- torchvision/csrc/ops/autograd/ps_roi_pool_kernel.cpp | 6 ++++-- torchvision/csrc/ops/autograd/roi_align_kernel.cpp | 6 ++++-- torchvision/csrc/ops/autograd/roi_pool_kernel.cpp | 6 ++++-- torchvision/csrc/ops/cpu/deform_conv2d_kernel.cpp | 4 ++-- torchvision/csrc/ops/cpu/nms_kernel.cpp | 2 +- torchvision/csrc/ops/cpu/ps_roi_align_kernel.cpp | 4 ++-- torchvision/csrc/ops/cpu/ps_roi_pool_kernel.cpp | 4 ++-- torchvision/csrc/ops/cpu/roi_align_kernel.cpp | 6 ++++-- torchvision/csrc/ops/cpu/roi_pool_kernel.cpp | 6 ++++-- torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu | 4 ++-- torchvision/csrc/ops/cuda/nms_kernel.cu | 2 +- torchvision/csrc/ops/cuda/ps_roi_align_kernel.cu | 4 ++-- torchvision/csrc/ops/cuda/ps_roi_pool_kernel.cu | 4 ++-- torchvision/csrc/ops/cuda/roi_align_kernel.cu | 6 ++++-- torchvision/csrc/ops/cuda/roi_pool_kernel.cu | 6 ++++-- torchvision/csrc/ops/deform_conv2d.cpp | 4 ++-- torchvision/csrc/ops/nms.cpp | 2 +- torchvision/csrc/ops/ps_roi_align.cpp | 4 ++-- torchvision/csrc/ops/ps_roi_pool.cpp | 4 ++-- torchvision/csrc/ops/roi_align.cpp | 4 ++-- torchvision/csrc/ops/roi_pool.cpp | 4 ++-- 29 files changed, 75 insertions(+), 49 deletions(-) diff --git a/torchvision/csrc/ops/autocast/deform_conv2d_kernel.cpp b/torchvision/csrc/ops/autocast/deform_conv2d_kernel.cpp index f9cbf97e4de..28c325be9b1 100644 --- a/torchvision/csrc/ops/autocast/deform_conv2d_kernel.cpp +++ b/torchvision/csrc/ops/autocast/deform_conv2d_kernel.cpp @@ -46,7 +46,8 @@ at::Tensor deform_conv2d_autocast( TORCH_LIBRARY_IMPL(torchvision, Autocast, m) { m.impl( - TORCH_SELECTIVE_NAME("deform_conv2d"), TORCH_FN(deform_conv2d_autocast)); + TORCH_SELECTIVE_NAME("torchvision::deform_conv2d"), + TORCH_FN(deform_conv2d_autocast)); } } // namespace ops diff --git a/torchvision/csrc/ops/autocast/nms_kernel.cpp b/torchvision/csrc/ops/autocast/nms_kernel.cpp index 9a35e380298..3a0ead004fd 100644 --- a/torchvision/csrc/ops/autocast/nms_kernel.cpp +++ b/torchvision/csrc/ops/autocast/nms_kernel.cpp @@ -22,7 +22,7 @@ at::Tensor nms_autocast( } // namespace TORCH_LIBRARY_IMPL(torchvision, Autocast, m) { - m.impl(TORCH_SELECTIVE_NAME("nms"), TORCH_FN(nms_autocast)); + m.impl(TORCH_SELECTIVE_NAME("torchvision::nms"), TORCH_FN(nms_autocast)); } } // namespace ops diff --git a/torchvision/csrc/ops/autocast/ps_roi_align_kernel.cpp b/torchvision/csrc/ops/autocast/ps_roi_align_kernel.cpp index a4b39f03a10..c93b26c8ad3 100644 --- a/torchvision/csrc/ops/autocast/ps_roi_align_kernel.cpp +++ b/torchvision/csrc/ops/autocast/ps_roi_align_kernel.cpp @@ -32,7 +32,9 @@ std::tuple ps_roi_align_autocast( } // namespace TORCH_LIBRARY_IMPL(torchvision, Autocast, m) { - m.impl(TORCH_SELECTIVE_NAME("ps_roi_align"), TORCH_FN(ps_roi_align_autocast)); + m.impl( + TORCH_SELECTIVE_NAME("torchvision::ps_roi_align"), + TORCH_FN(ps_roi_align_autocast)); } } // namespace ops diff --git a/torchvision/csrc/ops/autocast/ps_roi_pool_kernel.cpp b/torchvision/csrc/ops/autocast/ps_roi_pool_kernel.cpp index 76232c60803..1421680ea98 100644 --- a/torchvision/csrc/ops/autocast/ps_roi_pool_kernel.cpp +++ b/torchvision/csrc/ops/autocast/ps_roi_pool_kernel.cpp @@ -30,7 +30,9 @@ std::tuple ps_roi_pool_autocast( } // namespace TORCH_LIBRARY_IMPL(torchvision, Autocast, m) { - m.impl(TORCH_SELECTIVE_NAME("ps_roi_pool"), TORCH_FN(ps_roi_pool_autocast)); + m.impl( + TORCH_SELECTIVE_NAME("torchvision::ps_roi_pool"), + TORCH_FN(ps_roi_pool_autocast)); } } // namespace ops diff --git a/torchvision/csrc/ops/autocast/roi_align_kernel.cpp b/torchvision/csrc/ops/autocast/roi_align_kernel.cpp index d9174f1f53c..95457224ac0 100644 --- a/torchvision/csrc/ops/autocast/roi_align_kernel.cpp +++ b/torchvision/csrc/ops/autocast/roi_align_kernel.cpp @@ -31,7 +31,9 @@ at::Tensor roi_align_autocast( } // namespace TORCH_LIBRARY_IMPL(torchvision, Autocast, m) { - m.impl(TORCH_SELECTIVE_NAME("roi_align"), TORCH_FN(roi_align_autocast)); + m.impl( + TORCH_SELECTIVE_NAME("torchvision::roi_align"), + TORCH_FN(roi_align_autocast)); } } // namespace ops diff --git a/torchvision/csrc/ops/autocast/roi_pool_kernel.cpp b/torchvision/csrc/ops/autocast/roi_pool_kernel.cpp index 247492b2641..d317c38c792 100644 --- a/torchvision/csrc/ops/autocast/roi_pool_kernel.cpp +++ b/torchvision/csrc/ops/autocast/roi_pool_kernel.cpp @@ -30,7 +30,9 @@ std::tuple roi_pool_autocast( } // namespace TORCH_LIBRARY_IMPL(torchvision, Autocast, m) { - m.impl(TORCH_SELECTIVE_NAME("roi_pool"), TORCH_FN(roi_pool_autocast)); + m.impl( + TORCH_SELECTIVE_NAME("torchvision::roi_pool"), + TORCH_FN(roi_pool_autocast)); } } // namespace ops diff --git a/torchvision/csrc/ops/autograd/deform_conv2d_kernel.cpp b/torchvision/csrc/ops/autograd/deform_conv2d_kernel.cpp index 6de1c86522d..77b44b77f62 100644 --- a/torchvision/csrc/ops/autograd/deform_conv2d_kernel.cpp +++ b/torchvision/csrc/ops/autograd/deform_conv2d_kernel.cpp @@ -255,9 +255,10 @@ deform_conv2d_backward_autograd( TORCH_LIBRARY_IMPL(torchvision, Autograd, m) { m.impl( - TORCH_SELECTIVE_NAME("deform_conv2d"), TORCH_FN(deform_conv2d_autograd)); + TORCH_SELECTIVE_NAME("torchvision::deform_conv2d"), + TORCH_FN(deform_conv2d_autograd)); m.impl( - TORCH_SELECTIVE_NAME("_deform_conv2d_backward"), + TORCH_SELECTIVE_NAME("torchvision::_deform_conv2d_backward"), TORCH_FN(deform_conv2d_backward_autograd)); } diff --git a/torchvision/csrc/ops/autograd/ps_roi_align_kernel.cpp b/torchvision/csrc/ops/autograd/ps_roi_align_kernel.cpp index 3cab1464a5a..73c6fe72c25 100644 --- a/torchvision/csrc/ops/autograd/ps_roi_align_kernel.cpp +++ b/torchvision/csrc/ops/autograd/ps_roi_align_kernel.cpp @@ -154,9 +154,11 @@ at::Tensor ps_roi_align_backward_autograd( } // namespace TORCH_LIBRARY_IMPL(torchvision, Autograd, m) { - m.impl(TORCH_SELECTIVE_NAME("ps_roi_align"), TORCH_FN(ps_roi_align_autograd)); m.impl( - TORCH_SELECTIVE_NAME("_ps_roi_align_backward"), + TORCH_SELECTIVE_NAME("torchvision::ps_roi_align"), + TORCH_FN(ps_roi_align_autograd)); + m.impl( + TORCH_SELECTIVE_NAME("torchvision::_ps_roi_align_backward"), TORCH_FN(ps_roi_align_backward_autograd)); } diff --git a/torchvision/csrc/ops/autograd/ps_roi_pool_kernel.cpp b/torchvision/csrc/ops/autograd/ps_roi_pool_kernel.cpp index 6f6e36ce33e..c7b63bceaef 100644 --- a/torchvision/csrc/ops/autograd/ps_roi_pool_kernel.cpp +++ b/torchvision/csrc/ops/autograd/ps_roi_pool_kernel.cpp @@ -139,9 +139,11 @@ at::Tensor ps_roi_pool_backward_autograd( } // namespace TORCH_LIBRARY_IMPL(torchvision, Autograd, m) { - m.impl(TORCH_SELECTIVE_NAME("ps_roi_pool"), TORCH_FN(ps_roi_pool_autograd)); m.impl( - TORCH_SELECTIVE_NAME("_ps_roi_pool_backward"), + TORCH_SELECTIVE_NAME("torchvision::ps_roi_pool"), + TORCH_FN(ps_roi_pool_autograd)); + m.impl( + TORCH_SELECTIVE_NAME("torchvision::_ps_roi_pool_backward"), TORCH_FN(ps_roi_pool_backward_autograd)); } diff --git a/torchvision/csrc/ops/autograd/roi_align_kernel.cpp b/torchvision/csrc/ops/autograd/roi_align_kernel.cpp index c3b6fed6220..309ca21b784 100644 --- a/torchvision/csrc/ops/autograd/roi_align_kernel.cpp +++ b/torchvision/csrc/ops/autograd/roi_align_kernel.cpp @@ -154,9 +154,11 @@ at::Tensor roi_align_backward_autograd( } // namespace TORCH_LIBRARY_IMPL(torchvision, Autograd, m) { - m.impl(TORCH_SELECTIVE_NAME("roi_align"), TORCH_FN(roi_align_autograd)); m.impl( - TORCH_SELECTIVE_NAME("_roi_align_backward"), + TORCH_SELECTIVE_NAME("torchvision::roi_align"), + TORCH_FN(roi_align_autograd)); + m.impl( + TORCH_SELECTIVE_NAME("torchvision::_roi_align_backward"), TORCH_FN(roi_align_backward_autograd)); } diff --git a/torchvision/csrc/ops/autograd/roi_pool_kernel.cpp b/torchvision/csrc/ops/autograd/roi_pool_kernel.cpp index e396ff26992..bd08f7ab4ee 100644 --- a/torchvision/csrc/ops/autograd/roi_pool_kernel.cpp +++ b/torchvision/csrc/ops/autograd/roi_pool_kernel.cpp @@ -139,9 +139,11 @@ at::Tensor roi_pool_backward_autograd( } // namespace TORCH_LIBRARY_IMPL(torchvision, Autograd, m) { - m.impl(TORCH_SELECTIVE_NAME("roi_pool"), TORCH_FN(roi_pool_autograd)); m.impl( - TORCH_SELECTIVE_NAME("_roi_pool_backward"), + TORCH_SELECTIVE_NAME("torchvision::roi_pool"), + TORCH_FN(roi_pool_autograd)); + m.impl( + TORCH_SELECTIVE_NAME("torchvision::_roi_pool_backward"), TORCH_FN(roi_pool_backward_autograd)); } diff --git a/torchvision/csrc/ops/cpu/deform_conv2d_kernel.cpp b/torchvision/csrc/ops/cpu/deform_conv2d_kernel.cpp index 61066152468..834fabe1ab8 100644 --- a/torchvision/csrc/ops/cpu/deform_conv2d_kernel.cpp +++ b/torchvision/csrc/ops/cpu/deform_conv2d_kernel.cpp @@ -1144,10 +1144,10 @@ deform_conv2d_backward_kernel( TORCH_LIBRARY_IMPL(torchvision, CPU, m) { m.impl( - TORCH_SELECTIVE_NAME("deform_conv2d"), + TORCH_SELECTIVE_NAME("torchvision::deform_conv2d"), TORCH_FN(deform_conv2d_forward_kernel)); m.impl( - TORCH_SELECTIVE_NAME("_deform_conv2d_backward"), + TORCH_SELECTIVE_NAME("torchvision::_deform_conv2d_backward"), TORCH_FN(deform_conv2d_backward_kernel)); } diff --git a/torchvision/csrc/ops/cpu/nms_kernel.cpp b/torchvision/csrc/ops/cpu/nms_kernel.cpp index 53f77790614..8d12c70a567 100644 --- a/torchvision/csrc/ops/cpu/nms_kernel.cpp +++ b/torchvision/csrc/ops/cpu/nms_kernel.cpp @@ -109,7 +109,7 @@ at::Tensor nms_kernel( } // namespace TORCH_LIBRARY_IMPL(torchvision, CPU, m) { - m.impl(TORCH_SELECTIVE_NAME("nms"), TORCH_FN(nms_kernel)); + m.impl(TORCH_SELECTIVE_NAME("torchvision::nms"), TORCH_FN(nms_kernel)); } } // namespace ops diff --git a/torchvision/csrc/ops/cpu/ps_roi_align_kernel.cpp b/torchvision/csrc/ops/cpu/ps_roi_align_kernel.cpp index 90f60cc560b..5e33fc0bc62 100644 --- a/torchvision/csrc/ops/cpu/ps_roi_align_kernel.cpp +++ b/torchvision/csrc/ops/cpu/ps_roi_align_kernel.cpp @@ -423,10 +423,10 @@ at::Tensor ps_roi_align_backward_kernel( TORCH_LIBRARY_IMPL(torchvision, CPU, m) { m.impl( - TORCH_SELECTIVE_NAME("ps_roi_align"), + TORCH_SELECTIVE_NAME("torchvision::ps_roi_align"), TORCH_FN(ps_roi_align_forward_kernel)); m.impl( - TORCH_SELECTIVE_NAME("_ps_roi_align_backward"), + TORCH_SELECTIVE_NAME("torchvision::_ps_roi_align_backward"), TORCH_FN(ps_roi_align_backward_kernel)); } diff --git a/torchvision/csrc/ops/cpu/ps_roi_pool_kernel.cpp b/torchvision/csrc/ops/cpu/ps_roi_pool_kernel.cpp index bbd15f7de7c..607cbe4bab6 100644 --- a/torchvision/csrc/ops/cpu/ps_roi_pool_kernel.cpp +++ b/torchvision/csrc/ops/cpu/ps_roi_pool_kernel.cpp @@ -262,10 +262,10 @@ at::Tensor ps_roi_pool_backward_kernel( TORCH_LIBRARY_IMPL(torchvision, CPU, m) { m.impl( - TORCH_SELECTIVE_NAME("ps_roi_pool"), + TORCH_SELECTIVE_NAME("torchvision::ps_roi_pool"), TORCH_FN(ps_roi_pool_forward_kernel)); m.impl( - TORCH_SELECTIVE_NAME("_ps_roi_pool_backward"), + TORCH_SELECTIVE_NAME("torchvision::_ps_roi_pool_backward"), TORCH_FN(ps_roi_pool_backward_kernel)); } diff --git a/torchvision/csrc/ops/cpu/roi_align_kernel.cpp b/torchvision/csrc/ops/cpu/roi_align_kernel.cpp index 2efd4e3ffaa..8e86104513b 100644 --- a/torchvision/csrc/ops/cpu/roi_align_kernel.cpp +++ b/torchvision/csrc/ops/cpu/roi_align_kernel.cpp @@ -500,9 +500,11 @@ at::Tensor roi_align_backward_kernel( } // namespace TORCH_LIBRARY_IMPL(torchvision, CPU, m) { - m.impl(TORCH_SELECTIVE_NAME("roi_align"), TORCH_FN(roi_align_forward_kernel)); m.impl( - TORCH_SELECTIVE_NAME("_roi_align_backward"), + TORCH_SELECTIVE_NAME("torchvision::roi_align"), + TORCH_FN(roi_align_forward_kernel)); + m.impl( + TORCH_SELECTIVE_NAME("torchvision::_roi_align_backward"), TORCH_FN(roi_align_backward_kernel)); } diff --git a/torchvision/csrc/ops/cpu/roi_pool_kernel.cpp b/torchvision/csrc/ops/cpu/roi_pool_kernel.cpp index fd5db83ca14..b099523896a 100644 --- a/torchvision/csrc/ops/cpu/roi_pool_kernel.cpp +++ b/torchvision/csrc/ops/cpu/roi_pool_kernel.cpp @@ -237,9 +237,11 @@ at::Tensor roi_pool_backward_kernel( } // namespace TORCH_LIBRARY_IMPL(torchvision, CPU, m) { - m.impl(TORCH_SELECTIVE_NAME("roi_pool"), TORCH_FN(roi_pool_forward_kernel)); m.impl( - TORCH_SELECTIVE_NAME("_roi_pool_backward"), + TORCH_SELECTIVE_NAME("torchvision::roi_pool"), + TORCH_FN(roi_pool_forward_kernel)); + m.impl( + TORCH_SELECTIVE_NAME("torchvision::_roi_pool_backward"), TORCH_FN(roi_pool_backward_kernel)); } diff --git a/torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu b/torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu index 410f87da219..ea70630a7f6 100644 --- a/torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu +++ b/torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu @@ -1190,10 +1190,10 @@ deform_conv2d_backward_kernel( TORCH_LIBRARY_IMPL(torchvision, CUDA, m) { m.impl( - TORCH_SELECTIVE_NAME("deform_conv2d"), + TORCH_SELECTIVE_NAME("torchvision::deform_conv2d"), TORCH_FN(deform_conv2d_forward_kernel)); m.impl( - TORCH_SELECTIVE_NAME("_deform_conv2d_backward"), + TORCH_SELECTIVE_NAME("torchvision::_deform_conv2d_backward"), TORCH_FN(deform_conv2d_backward_kernel)); } diff --git a/torchvision/csrc/ops/cuda/nms_kernel.cu b/torchvision/csrc/ops/cuda/nms_kernel.cu index 662dbda78b7..8992f569ce7 100644 --- a/torchvision/csrc/ops/cuda/nms_kernel.cu +++ b/torchvision/csrc/ops/cuda/nms_kernel.cu @@ -168,7 +168,7 @@ at::Tensor nms_kernel( } // namespace TORCH_LIBRARY_IMPL(torchvision, CUDA, m) { - m.impl(TORCH_SELECTIVE_NAME("nms"), TORCH_FN(nms_kernel)); + m.impl(TORCH_SELECTIVE_NAME("torchvision::nms"), TORCH_FN(nms_kernel)); } } // namespace ops diff --git a/torchvision/csrc/ops/cuda/ps_roi_align_kernel.cu b/torchvision/csrc/ops/cuda/ps_roi_align_kernel.cu index 5c69da354a4..b9c04fc9973 100644 --- a/torchvision/csrc/ops/cuda/ps_roi_align_kernel.cu +++ b/torchvision/csrc/ops/cuda/ps_roi_align_kernel.cu @@ -441,10 +441,10 @@ at::Tensor ps_roi_align_backward_kernel( TORCH_LIBRARY_IMPL(torchvision, CUDA, m) { m.impl( - TORCH_SELECTIVE_NAME("ps_roi_align"), + TORCH_SELECTIVE_NAME("torchvision::ps_roi_align"), TORCH_FN(ps_roi_align_forward_kernel)); m.impl( - TORCH_SELECTIVE_NAME("_ps_roi_align_backward"), + TORCH_SELECTIVE_NAME("torchvision::_ps_roi_align_backward"), TORCH_FN(ps_roi_align_backward_kernel)); } diff --git a/torchvision/csrc/ops/cuda/ps_roi_pool_kernel.cu b/torchvision/csrc/ops/cuda/ps_roi_pool_kernel.cu index 1094f167757..85f43fa99a2 100644 --- a/torchvision/csrc/ops/cuda/ps_roi_pool_kernel.cu +++ b/torchvision/csrc/ops/cuda/ps_roi_pool_kernel.cu @@ -277,10 +277,10 @@ at::Tensor ps_roi_pool_backward_kernel( TORCH_LIBRARY_IMPL(torchvision, CUDA, m) { m.impl( - TORCH_SELECTIVE_NAME("ps_roi_pool"), + TORCH_SELECTIVE_NAME("torchvision::ps_roi_pool"), TORCH_FN(ps_roi_pool_forward_kernel)); m.impl( - TORCH_SELECTIVE_NAME("_ps_roi_pool_backward"), + TORCH_SELECTIVE_NAME("torchvision::_ps_roi_pool_backward"), TORCH_FN(ps_roi_pool_backward_kernel)); } diff --git a/torchvision/csrc/ops/cuda/roi_align_kernel.cu b/torchvision/csrc/ops/cuda/roi_align_kernel.cu index 4dd8faa97e7..48183f4908e 100644 --- a/torchvision/csrc/ops/cuda/roi_align_kernel.cu +++ b/torchvision/csrc/ops/cuda/roi_align_kernel.cu @@ -449,9 +449,11 @@ at::Tensor roi_align_backward_kernel( } // namespace TORCH_LIBRARY_IMPL(torchvision, CUDA, m) { - m.impl(TORCH_SELECTIVE_NAME("roi_align"), TORCH_FN(roi_align_forward_kernel)); m.impl( - TORCH_SELECTIVE_NAME("_roi_align_backward"), + TORCH_SELECTIVE_NAME("torchvision::roi_align"), + TORCH_FN(roi_align_forward_kernel)); + m.impl( + TORCH_SELECTIVE_NAME("torchvision::_roi_align_backward"), TORCH_FN(roi_align_backward_kernel)); } diff --git a/torchvision/csrc/ops/cuda/roi_pool_kernel.cu b/torchvision/csrc/ops/cuda/roi_pool_kernel.cu index 50d167e0591..6b953bdcdf5 100644 --- a/torchvision/csrc/ops/cuda/roi_pool_kernel.cu +++ b/torchvision/csrc/ops/cuda/roi_pool_kernel.cu @@ -260,9 +260,11 @@ at::Tensor roi_pool_backward_kernel( } // namespace TORCH_LIBRARY_IMPL(torchvision, CUDA, m) { - m.impl(TORCH_SELECTIVE_NAME("roi_pool"), TORCH_FN(roi_pool_forward_kernel)); m.impl( - TORCH_SELECTIVE_NAME("_roi_pool_backward"), + TORCH_SELECTIVE_NAME("torchvision::roi_pool"), + TORCH_FN(roi_pool_forward_kernel)); + m.impl( + TORCH_SELECTIVE_NAME("torchvision::_roi_pool_backward"), TORCH_FN(roi_pool_backward_kernel)); } diff --git a/torchvision/csrc/ops/deform_conv2d.cpp b/torchvision/csrc/ops/deform_conv2d.cpp index a19a8ca495a..073e16f2355 100644 --- a/torchvision/csrc/ops/deform_conv2d.cpp +++ b/torchvision/csrc/ops/deform_conv2d.cpp @@ -85,9 +85,9 @@ _deform_conv2d_backward( TORCH_LIBRARY_FRAGMENT(torchvision, m) { m.def(TORCH_SELECTIVE_SCHEMA( - "deform_conv2d(Tensor input, Tensor weight, Tensor offset, Tensor mask, Tensor bias, int stride_h, int stride_w, int pad_h, int pad_w, int dilation_h, int dilation_w, int groups, int offset_groups, bool use_mask) -> Tensor")); + "torchvision::deform_conv2d(Tensor input, Tensor weight, Tensor offset, Tensor mask, Tensor bias, int stride_h, int stride_w, int pad_h, int pad_w, int dilation_h, int dilation_w, int groups, int offset_groups, bool use_mask) -> Tensor")); m.def(TORCH_SELECTIVE_SCHEMA( - "_deform_conv2d_backward(Tensor grad, Tensor input, Tensor weight, Tensor offset, Tensor mask, Tensor bias, int stride_h, int stride_w, int pad_h, int pad_w, int dilation_h, int dilation_w, int groups, int offset_groups, bool use_mask) -> (Tensor, Tensor, Tensor, Tensor, Tensor)")); + "torchvision::_deform_conv2d_backward(Tensor grad, Tensor input, Tensor weight, Tensor offset, Tensor mask, Tensor bias, int stride_h, int stride_w, int pad_h, int pad_w, int dilation_h, int dilation_w, int groups, int offset_groups, bool use_mask) -> (Tensor, Tensor, Tensor, Tensor, Tensor)")); } } // namespace ops diff --git a/torchvision/csrc/ops/nms.cpp b/torchvision/csrc/ops/nms.cpp index 96674aea5c5..9ed8f713671 100644 --- a/torchvision/csrc/ops/nms.cpp +++ b/torchvision/csrc/ops/nms.cpp @@ -17,7 +17,7 @@ at::Tensor nms( TORCH_LIBRARY_FRAGMENT(torchvision, m) { m.def(TORCH_SELECTIVE_SCHEMA( - "nms(Tensor dets, Tensor scores, float iou_threshold) -> Tensor")); + "torchvision::nms(Tensor dets, Tensor scores, float iou_threshold) -> Tensor")); } } // namespace ops diff --git a/torchvision/csrc/ops/ps_roi_align.cpp b/torchvision/csrc/ops/ps_roi_align.cpp index 914b731c7b1..19f4c699d66 100644 --- a/torchvision/csrc/ops/ps_roi_align.cpp +++ b/torchvision/csrc/ops/ps_roi_align.cpp @@ -55,9 +55,9 @@ at::Tensor _ps_roi_align_backward( TORCH_LIBRARY_FRAGMENT(torchvision, m) { m.def(TORCH_SELECTIVE_SCHEMA( - "ps_roi_align(Tensor input, Tensor rois, float spatial_scale, int pooled_height, int pooled_width, int sampling_ratio) -> (Tensor, Tensor)")); + "torchvision::ps_roi_align(Tensor input, Tensor rois, float spatial_scale, int pooled_height, int pooled_width, int sampling_ratio) -> (Tensor, Tensor)")); m.def(TORCH_SELECTIVE_SCHEMA( - "_ps_roi_align_backward(Tensor grad, Tensor rois, Tensor channel_mapping, float spatial_scale, int pooled_height, int pooled_width, int sampling_ratio, int batch_size, int channels, int height, int width) -> Tensor")); + "torchvision::_ps_roi_align_backward(Tensor grad, Tensor rois, Tensor channel_mapping, float spatial_scale, int pooled_height, int pooled_width, int sampling_ratio, int batch_size, int channels, int height, int width) -> Tensor")); } } // namespace ops diff --git a/torchvision/csrc/ops/ps_roi_pool.cpp b/torchvision/csrc/ops/ps_roi_pool.cpp index 10b79e02b3c..0c633522820 100644 --- a/torchvision/csrc/ops/ps_roi_pool.cpp +++ b/torchvision/csrc/ops/ps_roi_pool.cpp @@ -51,9 +51,9 @@ at::Tensor _ps_roi_pool_backward( TORCH_LIBRARY_FRAGMENT(torchvision, m) { m.def(TORCH_SELECTIVE_SCHEMA( - "ps_roi_pool(Tensor input, Tensor rois, float spatial_scale, int pooled_height, int pooled_width) -> (Tensor, Tensor)")); + "torchvision::ps_roi_pool(Tensor input, Tensor rois, float spatial_scale, int pooled_height, int pooled_width) -> (Tensor, Tensor)")); m.def(TORCH_SELECTIVE_SCHEMA( - "_ps_roi_pool_backward(Tensor grad, Tensor rois, Tensor channel_mapping, float spatial_scale, int pooled_height, int pooled_width, int batch_size, int channels, int height, int width) -> Tensor")); + "torchvision::_ps_roi_pool_backward(Tensor grad, Tensor rois, Tensor channel_mapping, float spatial_scale, int pooled_height, int pooled_width, int batch_size, int channels, int height, int width) -> Tensor")); } } // namespace ops diff --git a/torchvision/csrc/ops/roi_align.cpp b/torchvision/csrc/ops/roi_align.cpp index 8ba35a4a71e..1e0d97ff979 100644 --- a/torchvision/csrc/ops/roi_align.cpp +++ b/torchvision/csrc/ops/roi_align.cpp @@ -65,9 +65,9 @@ at::Tensor _roi_align_backward( TORCH_LIBRARY_FRAGMENT(torchvision, m) { m.def(TORCH_SELECTIVE_SCHEMA( - "roi_align(Tensor input, Tensor rois, float spatial_scale, int pooled_height, int pooled_width, int sampling_ratio, bool aligned) -> Tensor")); + "torchvision::roi_align(Tensor input, Tensor rois, float spatial_scale, int pooled_height, int pooled_width, int sampling_ratio, bool aligned) -> Tensor")); m.def(TORCH_SELECTIVE_SCHEMA( - "_roi_align_backward(Tensor grad, Tensor rois, float spatial_scale, int pooled_height, int pooled_width, int batch_size, int channels, int height, int width, int sampling_ratio, bool aligned) -> Tensor")); + "torchvision::_roi_align_backward(Tensor grad, Tensor rois, float spatial_scale, int pooled_height, int pooled_width, int batch_size, int channels, int height, int width, int sampling_ratio, bool aligned) -> Tensor")); } } // namespace ops diff --git a/torchvision/csrc/ops/roi_pool.cpp b/torchvision/csrc/ops/roi_pool.cpp index 8240c8501ad..d88ec30ec2a 100644 --- a/torchvision/csrc/ops/roi_pool.cpp +++ b/torchvision/csrc/ops/roi_pool.cpp @@ -50,9 +50,9 @@ at::Tensor _roi_pool_backward( TORCH_LIBRARY_FRAGMENT(torchvision, m) { m.def(TORCH_SELECTIVE_SCHEMA( - "roi_pool(Tensor input, Tensor rois, float spatial_scale, int pooled_height, int pooled_width) -> (Tensor, Tensor)")); + "torchvision::roi_pool(Tensor input, Tensor rois, float spatial_scale, int pooled_height, int pooled_width) -> (Tensor, Tensor)")); m.def(TORCH_SELECTIVE_SCHEMA( - "_roi_pool_backward(Tensor grad, Tensor rois, Tensor argmax, float spatial_scale, int pooled_height, int pooled_width, int batch_size, int channels, int height, int width) -> Tensor")); + "torchvision::_roi_pool_backward(Tensor grad, Tensor rois, Tensor argmax, float spatial_scale, int pooled_height, int pooled_width, int batch_size, int channels, int height, int width) -> Tensor")); } } // namespace ops