guihao-liang:

it seems to be the backprop function for the constant 2.


Indeed. Internally, PyTorch loves to connect all relevant inputs to the graph, and if those don’t require gradients, you get None.