You could print the name and the gradient of all parameters after the backward call and check which parameters do not receive a valid gradient via:
for name, param in model.named_parameters():
    print(name, param.grad)

Some (or all) of these parameters should return a None gradient and based on the parameter name you could check, if these parameters are indeed not used in the model or if you’ve accidentally detached the computation graph.