Yes, I am using the loss after the if statement in the form of loss.bachward(). Please correct me if I am wrong,
You are suggesting:
loss = calculate the loss
if ~STATEMENT:
   loss = loss * 0

Am I correct?