nms.cpp 598 Bytes
Newer Older
1
#include "nms.h"
2
3

#include <torch/types.h>
4
5
6
7
8
9
10
11
12
13
14
15
16
17

namespace vision {
namespace ops {

at::Tensor nms(
    const at::Tensor& dets,
    const at::Tensor& scores,
    double iou_threshold) {
  static auto op = c10::Dispatcher::singleton()
                       .findSchemaOrThrow("torchvision::nms", "")
                       .typed<decltype(nms)>();
  return op.call(dets, scores, iou_threshold);
}

18
TORCH_LIBRARY_FRAGMENT(torchvision, m) {
19
20
  m.def(TORCH_SELECTIVE_SCHEMA(
      "torchvision::nms(Tensor dets, Tensor scores, float iou_threshold) -> Tensor"));
21
22
}

23
24
} // namespace ops
} // namespace vision