Difficulties calculating mean square error between 2 tensors

You would have to create an object for the loss function and use it afterwards:

criterion = nn.MSELoss()
loss = criterion(stack_3[0, :], stack_7[0, :])
1 Like