custom_ops.cpp 441 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <torch/script.h>

#include "ROIAlign.h"
#include "ROIPool.h"
#include "nms.h"

using namespace at;

static auto registry =
    torch::RegisterOperators()
        .op("torchvision::nms", &nms)
        .op("torchvision::roi_align(Tensor input, Tensor rois, float spatial_scale, int pooled_height, int pooled_width, int sampling_ratio) -> Tensor",
            &ROIAlign_forward)
        .op("torchvision::roi_pool", &ROIPool_forward);