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/torch_binding.cpp from kernels-community/deformable-detr: direct link, hf CLI and curl.
- Browser
- Download file 877 Bytes
-
https://huggingface.co/kernels-community/deformable-detr/resolve/refs%2Fpr%2F2/torch-ext/torch_binding.cpp
- Command line
-
hf download hf://kernels-community/deformable-detr@refs/pr/2/torch-ext/torch_binding.cpp
-
curl -L -o torch_binding.cpp https://huggingface.co/kernels-community/deformable-detr/resolve/refs%2Fpr%2F2/torch-ext/torch_binding.cpp
877 Bytes
| TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, ops) { | |
| ops.def("ms_deform_attn_forward(Tensor value, Tensor spatial_shapes," | |
| " Tensor level_start_index, Tensor sampling_loc," | |
| " Tensor attn_weight, int im2col_step) -> Tensor"); | |
| ops.impl("ms_deform_attn_forward", torch::kCUDA, &ms_deform_attn_cuda_forward); | |
| ops.def("ms_deform_attn_backward(Tensor value, Tensor spatial_shapes," | |
| " Tensor level_start_index, Tensor sampling_loc," | |
| " Tensor attn_weight, Tensor grad_output," | |
| " int im2col_step) -> Tensor[]"); | |
| ops.impl("ms_deform_attn_backward", torch::kCUDA, &ms_deform_attn_cuda_backward); | |
| } | |
| REGISTER_EXTENSION(TORCH_EXTENSION_NAME) | |