Looking at again, I am abit confused about your code. forward_backward function returns the pair (grad,loss), but you have treated the result (loss_v1 and loss_v2) as simple tensors. Maybe you pointed to the wrong commit of the insightface repository ?