Thank for the reply.
The nature of my loss is such that i have to iterate over a list of numbers for each ouput of my network and then calculate the total loss. So, since my network kas 1 output and a batch size of 1000, is there any way to do it without a for loop ?