Instructions to use kernels-community/torch_harmonics_attn with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Kernels
How to use kernels-community/torch_harmonics_attn 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/torch_harmonics_attn", version=1) - Notebooks
- Google Colab
- Kaggle
Download torch-ext/torch_binding.cpp from kernels-community/torch_harmonics_attn: direct link, hf CLI and curl.
- Browser
- Download file 740 Bytes
-
https://huggingface.co/kernels-community/torch_harmonics_attn/resolve/main/torch-ext/torch_binding.cpp
- Command line
-
hf download hf://kernels-community/torch_harmonics_attn/torch-ext/torch_binding.cpp
-
curl -L -o torch_binding.cpp https://huggingface.co/kernels-community/torch_harmonics_attn/resolve/main/torch-ext/torch_binding.cpp
740 Bytes
| TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, ops) { | |
| ops.def("s2_attention_bwd_dkvq_cuda(Tensor kx, Tensor vx, Tensor qy, Tensor dy, Tensor quad_weights, Tensor psi_col_idx, Tensor psi_row_off, int nlon_in, int nlat_out, int nlon_out) -> (Tensor, Tensor, Tensor)"); | |
| ops.impl("s2_attention_bwd_dkvq_cuda", torch::kCUDA, &s2_attention_bwd_dkvq_cuda); | |
| ops.def("s2_attention_fwd_cuda(Tensor kx, Tensor vx, Tensor qy, Tensor quad_weights, Tensor psi_col_idx, Tensor psi_row_off, int nlon_in, int nlat_out, int nlon_out) -> Tensor"); | |
| ops.impl("s2_attention_fwd_cuda", torch::kCUDA, &s2_attention_fwd_cuda); | |
| } | |
| REGISTER_EXTENSION(TORCH_EXTENSION_NAME) |