"vscode:/vscode.git/clone" did not exist on "2e544bd77afe019c4bb9d8c6882879c48d3ac65f"
nms.cpp 784 Bytes
Newer Older
1
#include "nms.h"
2

3
4
#include <ATen/core/dispatch/Dispatcher.h>
#include <torch/library.h>
5
#include <torch/types.h>
6
7
8
9
10
11
12
13

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
14
  C10_LOG_API_USAGE_ONCE("torchvision.csrc.ops.nms.nms");
15
16
17
18
19
20
  static auto op = c10::Dispatcher::singleton()
                       .findSchemaOrThrow("torchvision::nms", "")
                       .typed<decltype(nms)>();
  return op.call(dets, scores, iou_threshold);
}

21
TORCH_LIBRARY_FRAGMENT(torchvision, m) {
22
  m.set_python_module("torchvision._meta_registrations");
23
24
  m.def(TORCH_SELECTIVE_SCHEMA(
      "torchvision::nms(Tensor dets, Tensor scores, float iou_threshold) -> Tensor"));
25
26
}

27
28
} // namespace ops
} // namespace vision