Thank you for the response, say your model outputs x and your target values are y. So x and y will be
x=torch.rand(100,1,32,32)
y=torch.rand(100,1,32,32).
So i want to sum over input x first before I sum over the difference between the pixels between x and y. I want the output to be a scalar, i think it would be something like this
((x-y)**2).sum(dim=[1,2,3]).sum()