Instructions to use kernels-community/deformable-detr with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Kernels
How to use kernels-community/deformable-detr with Kernels:
# !pip install kernels from kernels import get_kernel # a version (or an explicit revision) is required; see the "Files and versions" tab for the available ones kernel = get_kernel("kernels-community/deformable-detr", version=1) - Notebooks
- Google Colab
- Kaggle
Download torch-ext/ms_deform_attn_cpu.cpp from kernels-community/deformable-detr: direct link, hf CLI and curl.
- Browser
- Download file 1.26 kB
-
https://huggingface.co/kernels-community/deformable-detr/resolve/refs%2Fpr%2F2/torch-ext/ms_deform_attn_cpu.cpp
- Command line
-
hf download hf://kernels-community/deformable-detr@refs/pr/2/torch-ext/ms_deform_attn_cpu.cpp
-
curl -L -o ms_deform_attn_cpu.cpp https://huggingface.co/kernels-community/deformable-detr/resolve/refs%2Fpr%2F2/torch-ext/ms_deform_attn_cpu.cpp
1.26 kB
| /*! | |
| ************************************************************************************************** | |
| * Deformable DETR | |
| * Copyright (c) 2020 SenseTime. All Rights Reserved. | |
| * Licensed under the Apache License, Version 2.0 [see LICENSE for details] | |
| ************************************************************************************************** | |
| * Modified from https://github.com/chengdazhi/Deformable-Convolution-V2-PyTorch/tree/pytorch_1.0.0 | |
| ************************************************************************************************** | |
| */ | |
| at::Tensor | |
| ms_deform_attn_cpu_forward( | |
| const at::Tensor &value, | |
| const at::Tensor &spatial_shapes, | |
| const at::Tensor &level_start_index, | |
| const at::Tensor &sampling_loc, | |
| const at::Tensor &attn_weight, | |
| const int im2col_step) | |
| { | |
| AT_ERROR("Not implement on cpu"); | |
| } | |
| std::vector<at::Tensor> | |
| ms_deform_attn_cpu_backward( | |
| const at::Tensor &value, | |
| const at::Tensor &spatial_shapes, | |
| const at::Tensor &level_start_index, | |
| const at::Tensor &sampling_loc, | |
| const at::Tensor &attn_weight, | |
| const at::Tensor &grad_output, | |
| const int im2col_step) | |
| { | |
| AT_ERROR("Not implement on cpu"); | |
| } | |