I am using a model such that the loss is a linear combination of three losses, two from PyTorch and one customized. Simply said:
custom_loss =my_loss(out3-t3)
loss = torch.nn.L1Loss(out1-t1) + torch.nn.L1Loss(out2-t2)  + custom_loss

How do I know for sure that the custom_loss is working as intended? I have set everything in my_loss using requires_grad. Now, when I test custom_loss after Line-1 it gives True, as follows:
print(custom_loss.requires_grad)
True

Also, when I print it, I get:
print(custom_loss)
tensor(0.6144, device='cuda:0', grad_fn=<divBackward0>)

So, I think everything is alright. However, I am still not sure if my_loss is used in the backward pass. That is, if the weights’ update is only based on the two other losses.