Tutorial: https://pytorch.org/tutorials/advanced/cpp_custom_ops.html#cpp-custom-ops-tutorial The Custom Operators Manual