Premium problem53. Mean Squared Error

Easy Locked

Return the mean squared error between pred and target: the average of (pred_i - target_i)^2 over all elements.

Input

pred = tensor([1., 2., 3.])
target = tensor([1.5000, 2.5000, 2.0000])

Output

tensor(0.5000)

Premium problem

This one's part of Premium. Unlock the full PyTorch track plus every other premium problem on the site.

Implement solve(...)