Skip to content
masterclass Buddy

PyTorch · Function

F.mse_loss

Computes squared error between predicted and ground-truth values. It can weight samples and return unreduced, averaged, or summed results.

Last updated

Syntax

torch.nn.functional.mse_loss(input, target, size_average=None, reduce=None, reduction='mean', weight=None)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • MSELoss

Source: torch.nn.functional.mse_loss — PyTorch 2.15 documentation. Checked 2026-11-03.