Pytorch code to approximate a sin function

https://pytorch.org/tutorials/beginner/pytorch_with_examples.html
code in paragraph : nn module
PyTorch: nn

This code only works for me after replacing:

loss_fn = torch.nn.MSELoss(reduction=‘sum’)

with:

loss_fn = torch.nn.MSELoss()

Could you describe what kind of error you are seeing if you don’t replace the loss_fn?