I think this is not the reason, I write the code following the pytorch example “https://pytorch.org/tutorials/advanced/numpy_extensions_tutorial.html 2”. I wonder how the pytorch can calculate gradient of any custom module correctly, and if this can be calculated correctly, why I need to write the backward function instead of using autograd mechanics?