Download torch-ext/torch_binding.cpp from phanerozoic/bitnet-cpu: direct link, hf CLI and curl.
- Browser
- Download file 689 Bytes
-
https://huggingface.co/kernels/phanerozoic/bitnet-cpu/resolve/v1/torch-ext/torch_binding.cpp
- Command line
-
hf download hf://phanerozoic/bitnet-cpu@v1/torch-ext/torch_binding.cpp
-
curl -L -o torch_binding.cpp https://huggingface.co/kernels/phanerozoic/bitnet-cpu/resolve/v1/torch-ext/torch_binding.cpp
689 Bytes
| TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, ops) { | |
| ops.def("quantize_act(Tensor! Aq, Tensor! scale, Tensor a) -> ()"); | |
| ops.def("bitnet_gemv_fused(Tensor! out, Tensor a, Tensor w_packed, Tensor scale_wt) -> ()"); | |
| ops.def("bitnet_gemm(Tensor! out, Tensor a_int8, Tensor w_packed, Tensor scale_act, Tensor scale_wt, Tensor? scratch) -> ()"); | |
| ops.impl("quantize_act", torch::kCPU, &quantize_act); | |
| ops.impl("bitnet_gemv_fused", torch::kCPU, &bitnet_gemv_fused); | |
| ops.impl("bitnet_gemm", torch::kCPU, &bitnet_gemm); | |
| } | |
| REGISTER_EXTENSION(TORCH_EXTENSION_NAME) | |