Loss for multiple output in multitask CNN

I think the first two pieces of code should work fine and have the same net effect.
The last one seems incorrect as it would duplicate the backward computation.
You can refer to post below for more explanations

4 Likes