Hi,
Since f2 is not computed in a differentiable manner, from the autograd point of view, it is the same as if you were adding a constant number to your loss.
And when taking derivatives, a constant number does not change anything, so you can actually remove f2 from this line and you will see the exact same behavior wrt to the gradients that are computed.