Creation of custom CUDA kernels in Pytorch

Hello everybody!
We’re working on novel software for micromagnetic simulations.
And we wanna use Pytorch for all stuff.
My question is simple - is it possible to create a custom CUDA Kernel? I mean, if we wanna make some nontrivial tensor logic at only 1 kernel, how we can do it?

Thanks in advance,
Ruslan

Yes, that’s possible and you would use a custom CUDAExtension for these use cases e.g. as explained in this tutorial.

Thanks a lot!
We’ll try to use it.