Download segmentation/ops_dcnv3/src/dcnv3.h from Leonardo6/git: direct link, hf CLI and curl.
- Browser
- Download file 2.52 kB
-
https://huggingface.co/Leonardo6/git/resolve/main/segmentation/ops_dcnv3/src/dcnv3.h
- Command line
-
hf download hf://Leonardo6/git/segmentation/ops_dcnv3/src/dcnv3.h
-
curl -L -o dcnv3.h https://huggingface.co/Leonardo6/git/resolve/main/segmentation/ops_dcnv3/src/dcnv3.h
2.52 kB
| /*! | |
| ************************************************************************************************** | |
| * InternImage | |
| * Copyright (c) 2022 OpenGVLab | |
| * Licensed under The MIT License [see LICENSE for details] | |
| ************************************************************************************************** | |
| * Modified from | |
| *https://github.com/chengdazhi/Deformable-Convolution-V2-PyTorch/tree/pytorch_1.0.0 | |
| ************************************************************************************************** | |
| */ | |
| at::Tensor dcnv3_forward(const at::Tensor &input, const at::Tensor &offset, | |
| const at::Tensor &mask, const int kernel_h, | |
| const int kernel_w, const int stride_h, | |
| const int stride_w, const int pad_h, const int pad_w, | |
| const int dilation_h, const int dilation_w, | |
| const int group, const int group_channels, | |
| const float offset_scale, const int im2col_step) { | |
| if (input.type().is_cuda()) { | |
| return dcnv3_cuda_forward(input, offset, mask, kernel_h, kernel_w, | |
| stride_h, stride_w, pad_h, pad_w, dilation_h, | |
| dilation_w, group, group_channels, | |
| offset_scale, im2col_step); | |
| AT_ERROR("Not compiled with GPU support"); | |
| } | |
| AT_ERROR("Not implemented on the CPU"); | |
| } | |
| std::vector<at::Tensor> | |
| dcnv3_backward(const at::Tensor &input, const at::Tensor &offset, | |
| const at::Tensor &mask, const int kernel_h, const int kernel_w, | |
| const int stride_h, const int stride_w, const int pad_h, | |
| const int pad_w, const int dilation_h, const int dilation_w, | |
| const int group, const int group_channels, | |
| const float offset_scale, const at::Tensor &grad_output, | |
| const int im2col_step) { | |
| if (input.type().is_cuda()) { | |
| return dcnv3_cuda_backward(input, offset, mask, kernel_h, kernel_w, | |
| stride_h, stride_w, pad_h, pad_w, dilation_h, | |
| dilation_w, group, group_channels, | |
| offset_scale, grad_output, im2col_step); | |
| AT_ERROR("Not compiled with GPU support"); | |
| } | |
| AT_ERROR("Not implemented on the CPU"); | |
| } | |