I think you want to use somewhat regression loss.
Then, they are the same in the aspect of gradient.
I think the first option is much better than the second one because you can apply the different optimizer and learning rate to each targets with the first option.