Kasi_Chennupati:

so to avoid the mismatch of weight data when the second loss is applied


I don’t quite understand the use case, since you are adding both losses in your initial post and call loss.backward() on the accumulated loss.