Hi,
In 99.9% of the cases, the output loss is scalar and so what you want here is a single 1 (which is the default value) as this will compute the full gradient of your function.
If there is more than one output, then there is no natural value to set so it has to be provided by the user.
Then the value you set depends what you want to do, there is no “usual” value in this case.
I said a vector full of 1s because that corresponds to the sum() you were asking about. But that’s it.
There are very little cases where this arg is actually needed.
The main one I know of is for backpropagation through time were you want to stage the backwardprop of each step independently so that you can run just the right number.
In that case, you will need to manually chain the backward calls and you can use this argument for that.