vision_cpu.h 3.07 KB
Newer Older
1
2
#pragma once
#include <torch/extension.h>
3
#include "../macros.h"
4
5

VISION_API std::tuple<at::Tensor, at::Tensor> ROIPool_forward_cpu(
6
7
8
9
10
11
    const at::Tensor& input,
    const at::Tensor& rois,
    const float spatial_scale,
    const int pooled_height,
    const int pooled_width);

12
VISION_API at::Tensor ROIPool_backward_cpu(
13
14
15
16
17
18
19
20
21
22
23
    const at::Tensor& grad,
    const at::Tensor& rois,
    const at::Tensor& argmax,
    const float spatial_scale,
    const int pooled_height,
    const int pooled_width,
    const int batch_size,
    const int channels,
    const int height,
    const int width);

24
VISION_API at::Tensor ROIAlign_forward_cpu(
25
26
    const at::Tensor& input,
    const at::Tensor& rois,
27
28
29
30
31
    double spatial_scale,
    int64_t pooled_height,
    int64_t pooled_width,
    int64_t sampling_ratio,
    bool aligned);
32

33
VISION_API at::Tensor ROIAlign_backward_cpu(
34
35
    const at::Tensor& grad,
    const at::Tensor& rois,
36
37
38
39
40
41
42
43
44
    double spatial_scale,
    int64_t pooled_height,
    int64_t pooled_width,
    int64_t batch_size,
    int64_t channels,
    int64_t height,
    int64_t width,
    int64_t sampling_ratio,
    bool aligned);
45

46
VISION_API std::tuple<at::Tensor, at::Tensor> PSROIPool_forward_cpu(
47
48
49
50
51
52
    const at::Tensor& input,
    const at::Tensor& rois,
    const float spatial_scale,
    const int pooled_height,
    const int pooled_width);

53
VISION_API at::Tensor PSROIPool_backward_cpu(
54
55
56
57
58
59
60
61
62
63
64
    const at::Tensor& grad,
    const at::Tensor& rois,
    const at::Tensor& mapping_channel,
    const float spatial_scale,
    const int pooled_height,
    const int pooled_width,
    const int batch_size,
    const int channels,
    const int height,
    const int width);

65
VISION_API std::tuple<at::Tensor, at::Tensor> PSROIAlign_forward_cpu(
66
67
    const at::Tensor& input,
    const at::Tensor& rois,
68
69
70
71
    double spatial_scale,
    int64_t pooled_height,
    int64_t pooled_width,
    int64_t sampling_ratio);
72

73
VISION_API at::Tensor PSROIAlign_backward_cpu(
74
75
    const at::Tensor& grad,
    const at::Tensor& rois,
76
77
78
79
80
81
82
83
84
    const at::Tensor& channel_mapping,
    double spatial_scale,
    int64_t pooled_height,
    int64_t pooled_width,
    int64_t sampling_ratio,
    int64_t batch_size,
    int64_t channels,
    int64_t height,
    int64_t width);
85

86
VISION_API at::Tensor nms_cpu(
87
88
    const at::Tensor& dets,
    const at::Tensor& scores,
Vasilis Vryniotis's avatar
Vasilis Vryniotis committed
89
    double iou_threshold);
90

91
VISION_API at::Tensor DeformConv2d_forward_cpu(
92
93
94
95
    const at::Tensor& input,
    const at::Tensor& weight,
    const at::Tensor& offset,
    const at::Tensor& bias,
96
97
98
99
100
101
102
103
    int64_t stride_h,
    int64_t stride_w,
    int64_t pad_h,
    int64_t pad_w,
    int64_t dilation_h,
    int64_t dilation_w,
    int64_t groups,
    int64_t deformable_groups);
104

105
VISION_API std::tuple<at::Tensor, at::Tensor, at::Tensor, at::Tensor>
106
107
108
109
110
111
DeformConv2d_backward_cpu(
    const at::Tensor& grad_out,
    const at::Tensor& input,
    const at::Tensor& weight,
    const at::Tensor& offset,
    const at::Tensor& bias,
112
113
114
115
116
117
118
119
    int64_t stride_h,
    int64_t stride_w,
    int64_t pad_h,
    int64_t pad_w,
    int64_t dilation_h,
    int64_t dilation_w,
    int64_t groups,
    int64_t deformable_groups);