Hi, I have to imlpement a custom loss function in pytorch. The network outputs a single tensor and my batch size if 1000. I have to take each tensor from the output and do some operations with it and return a value. My question is, do I need a for loop to iterate over all the tensors in the output batch, find the loss for each tensor and then do the mean or how can I do it more efficiently ?