Best value for 'reduction' parameter?

which is the best value to reduction instead of size_average=‘false’ to solve this error:
warnings.warn(warning.format(ret)) UserWarning: size_average and reduce args will be deprecated, please use reduction=‘mean’ instead

def loss_function(recon_x, x, pad_index):
MSE = F.mse_loss(recon_xpad_index, xpad_index, size_average=‘false’)
return MSE

reduction=‘mean’ as mentioned in error message or reduction=‘none’

To me it is not an error. The solution is already shown in the warning message, which is to replace size_average='false' with reduction='none', if you wish to keep your input dimension:)

thank you for reply but in warning message said (reduction=‘mean’)not ‘none’ if I should track the warning,and when I put reduction=‘none’ H get this error

File “C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\”, line 67, in _make_grads
raise RuntimeError(“grad can be implicitly created only for scalar outputs”)
RuntimeError: grad can be implicitly created only for scalar outputs