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

#include <torch/types.h>
4
5
6
7
8
9
10
11

namespace vision {
namespace ops {

at::Tensor nms(
    const at::Tensor& dets,
    const at::Tensor& scores,
    double iou_threshold) {
Kai Zhang's avatar
Kai Zhang committed
12
  C10_LOG_API_USAGE_ONCE("torchvision.csrc.ops.nms.nms");
13
14
15
16
17
18
  static auto op = c10::Dispatcher::singleton()
                       .findSchemaOrThrow("torchvision::nms", "")
                       .typed<decltype(nms)>();
  return op.call(dets, scores, iou_threshold);
}

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

24
25
} // namespace ops
} // namespace vision