Instructions to use kernels-community/relu with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Kernels
How to use kernels-community/relu 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/relu", version=1) - Notebooks
- Google Colab
- Kaggle
Download build/torch-ext/torch_binding.cpp from kernels-community/relu: direct link, hf CLI and curl.
- Browser
- Download file 457 Bytes
-
https://huggingface.co/kernels-community/relu/resolve/main/build/torch-ext/torch_binding.cpp
- Command line
-
hf download hf://kernels-community/relu/build/torch-ext/torch_binding.cpp
-
curl -L -o torch_binding.cpp https://huggingface.co/kernels-community/relu/resolve/main/build/torch-ext/torch_binding.cpp
457 Bytes
| TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, ops) { | |
| ops.def("relu(Tensor! out, Tensor input) -> ()"); | |
| ops.impl("relu", torch::kCUDA, &relu); | |
| ops.impl("relu", torch::kMPS, relu); | |
| ops.impl("relu", torch::kXPU, &relu); | |
| } | |
| REGISTER_EXTENSION(TORCH_EXTENSION_NAME) |