Hi,
I think based on your error, euclidean distance will return a float number for any two nd matrix. So de+= is always a float number. std cannot be computed for a single float number.
Could you please provide what library you are using for calculating euclidean distance?
But typically, you can calculate it using torch.dist(output, input, 2).  Here is the documentation 1.
Bests