#include #include "registration.h" #include "torch_binding.h" TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, ops) { ops.def("fp4_quantize(Tensor x, Tensor(a!) resid, bool stochastic, int seed, int step) -> (Tensor, Tensor)"); ops.def("fp4_dequantize(Tensor packed, Tensor scale, int M, int K) -> Tensor"); #if defined(CUDA_KERNEL) || defined(ROCM_KERNEL) ops.impl("fp4_quantize", torch::kCUDA, &fp4_quantize); ops.impl("fp4_dequantize", torch::kCUDA, &fp4_dequantize); #endif } REGISTER_EXTENSION(TORCH_EXTENSION_NAME)