forked from CharlesShang/DCNv2
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tianyou.gty
committed
May 17, 2022
1 parent
711fe28
commit ff5efb8
Showing
3 changed files
with
76 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,26 @@ | ||
|
||
#include "dcn_v2.h" | ||
#include <torch/script.h> | ||
|
||
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { | ||
m.def("dcn_v2_forward", &dcn_v2_forward, "dcn_v2_forward"); | ||
m.def("dcn_v2_backward", &dcn_v2_backward, "dcn_v2_backward"); | ||
m.def("dcn_v2_psroi_pooling_forward", &dcn_v2_psroi_pooling_forward, "dcn_v2_psroi_pooling_forward"); | ||
m.def("dcn_v2_psroi_pooling_backward", &dcn_v2_psroi_pooling_backward, "dcn_v2_psroi_pooling_backward"); | ||
m.def("dcn_v2_psroi_pooling_forward", &dcn_v2_psroi_pooling_forward, | ||
"dcn_v2_psroi_pooling_forward"); | ||
m.def("dcn_v2_psroi_pooling_backward", &dcn_v2_psroi_pooling_backward, | ||
"dcn_v2_psroi_pooling_backward"); | ||
} | ||
|
||
inline at::Tensor dcn_v2(const at::Tensor &input, const at::Tensor &weight, | ||
const at::Tensor &bias, const at::Tensor &offset, | ||
const at::Tensor &mask, const int64_t kernel_h, | ||
const int64_t kernel_w, const int64_t stride_h, | ||
const int64_t stride_w, const int64_t pad_h, | ||
const int64_t pad_w, const int64_t dilation_h, | ||
const int64_t dilation_w, | ||
const int64_t deformable_group) { | ||
return dcn_v2_forward(input, weight, bias, offset, mask, kernel_h, kernel_w, | ||
stride_h, stride_w, pad_h, pad_w, dilation_h, | ||
dilation_w, deformable_group); | ||
} | ||
static auto registry = torch::RegisterOperators().op("custom::dcn_v2", &dcn_v2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters