I just read this tutorial and it does not touch the backward part.
https://pytorch.org/tutorials/advanced/torch_script_custom_ops.html 14
My understanding is that to get autograd work, we will also need to register the corresponding backward function. However, I could not find how this works. I checked PyTorch source code (torch/csrc/autograd/generated/VariableTypeEverything.cpp) and could not find where backward functions are registered either.
Help will be appreciated!