You need to replace the deprecated arguments with the given suggestion.
See here how they are are generating the warning message.
https://fossies.org/linux/pytorch/torch/nn/_reduction.py 327
It will also help you understand why the reduction argument makes the other two redundant.