#include #include "registration.h" #include "torch_binding.h" // Registers `flash_attention_in_cuda_from_scratch` as a custom op so it is callable from Python as // torch.ops.flash_attention_in_cuda_from_scratch.flash_attention_in_cuda_from_scratch(...). Adjust the schema to your kernel. TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, ops) { ops.def("flash_attention_in_cuda_from_scratch(Tensor! out, Tensor input) -> ()"); ops.impl("flash_attention_in_cuda_from_scratch", torch::kCUDA, &flash_attention_in_cuda_from_scratch); } REGISTER_EXTENSION(TORCH_EXTENSION_NAME)