Gradient of output of network with respect to parameters

Hi,
So my output is not scalar. Is that case is there any function which I can use.