Suppose I have a multiple losses defined as
losses = ... # a tensor with shape: (10,)
Now I want to find the gradient each loss over a weight w
for i in range(len(10)):
grad[i] = tf.gradients(losses[i], w)
Now, can I do this without the above for loop but directly?