Can you share how do we enable that?

Ho yes sure.
torch.autograd.set_detect_anomaly(True)

No i don’t have this Alban;

Ok, And do you manually provide grad_output to .backward() or autograd.grad() ?