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, :])
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, :])