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

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
VISION_API at::Tensor DeformConv2d_forward_cuda(
    const at::Tensor& input,
    const at::Tensor& weight,
    const at::Tensor& offset,
    const at::Tensor& bias,
    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);

VISION_API std::tuple<at::Tensor, at::Tensor, at::Tensor, at::Tensor>
DeformConv2d_backward_cuda(
    const at::Tensor& grad_out,
    const at::Tensor& input,
    const at::Tensor& weight,
    const at::Tensor& offset,
    const at::Tensor& bias,
    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);

VISION_API at::Tensor nms_cuda(
    const at::Tensor& dets,
    const at::Tensor& scores,
    double iou_threshold);

VISION_API std::tuple<at::Tensor, at::Tensor> PSROIAlign_forward_cuda(
41
42
    const at::Tensor& input,
    const at::Tensor& rois,
43
44
45
    double spatial_scale,
    int64_t pooled_height,
    int64_t pooled_width,
46
    int64_t sampling_ratio);
47

48
VISION_API at::Tensor PSROIAlign_backward_cuda(
49
50
    const at::Tensor& grad,
    const at::Tensor& rois,
51
    const at::Tensor& channel_mapping,
52
53
54
    double spatial_scale,
    int64_t pooled_height,
    int64_t pooled_width,
55
    int64_t sampling_ratio,
56
57
58
    int64_t batch_size,
    int64_t channels,
    int64_t height,
59
    int64_t width);
60

61
VISION_API std::tuple<at::Tensor, at::Tensor> PSROIPool_forward_cuda(
62
63
    const at::Tensor& input,
    const at::Tensor& rois,
64
65
66
    double spatial_scale,
    int64_t pooled_height,
    int64_t pooled_width);
67

68
VISION_API at::Tensor PSROIPool_backward_cuda(
69
70
    const at::Tensor& grad,
    const at::Tensor& rois,
71
72
73
74
75
76
77
78
    const at::Tensor& channel_mapping,
    double spatial_scale,
    int64_t pooled_height,
    int64_t pooled_width,
    int64_t batch_size,
    int64_t channels,
    int64_t height,
    int64_t width);
79

80
VISION_API at::Tensor ROIAlign_forward_cuda(
81
82
    const at::Tensor& input,
    const at::Tensor& rois,
83
84
85
    double spatial_scale,
    int64_t pooled_height,
    int64_t pooled_width,
86
87
    int64_t sampling_ratio,
    bool aligned);
88

89
VISION_API at::Tensor ROIAlign_backward_cuda(
90
91
    const at::Tensor& grad,
    const at::Tensor& rois,
92
93
94
95
96
97
    double spatial_scale,
    int64_t pooled_height,
    int64_t pooled_width,
    int64_t batch_size,
    int64_t channels,
    int64_t height,
98
99
100
    int64_t width,
    int64_t sampling_ratio,
    bool aligned);
101

102
VISION_API std::tuple<at::Tensor, at::Tensor> ROIPool_forward_cuda(
103
    const at::Tensor& input,
104
105
106
107
    const at::Tensor& rois,
    const double spatial_scale,
    const int64_t pooled_height,
    const int64_t pooled_width);
108

109
110
111
112
113
114
115
116
117
118
119
VISION_API at::Tensor ROIPool_backward_cuda(
    const at::Tensor& grad,
    const at::Tensor& rois,
    const at::Tensor& argmax,
    const double spatial_scale,
    const int64_t pooled_height,
    const int64_t pooled_width,
    const int64_t batch_size,
    const int64_t channels,
    const int64_t height,
    const int64_t width);