Sure, pytorch has provides both python and C++ to extend custom op. Further more, cuda and other accelerate device have been supported. You can refer to pytorch tutorial https://pytorch.org/tutorials/advanced/cpp_extension.html 2.
Thanks,
Alan