Trying to combine several loss function in a dict called loss like so
err = torch.sum(torch.stack([l(input, label) for l in loss.values()]))
I am wondering if this breaks the connection for back prop
debugging tells me

<bound method Tensor.backward of tensor(17353.5000, device=‘cuda:0’, grad_fn=)>

which look ok but I am not certain if using an intermediate list followed by torch.stack succeeds in finalizing the computational graph
maybe someone knows the answer?