Note that the different paths are triggered, if the target requires gradients, not the model output

Ah, true… but, why would the targets require gradient ?
As in, shouldn’t get gradient be computed on the outputs of the model by comparing them to the targets (in this case via the MSE loss), what’s the point of having a gradient for the target vector since it’s already “correct” ?