code: def mean_squared_error(
      pred_dist: MultivariateNormal,
      test_y: torch.Tensor,
      squared: bool = True,
  ):
      """
      Mean squared error.
      """
      combine_dim = (
          -2
          if isinstance(pred_dist, MultitaskMultivariateNormal)
          else -1
      )
      res = torch.square(pred_dist.mean - test_y).mean(dim=combine_dim)
      if not squared:
          return res**0.5
      return res
  
file_path: gpytorch/gpytorch/metrics/metrics.py
imports: from math import pi
  from typing import Optional
  import torch
  from ..distributions import MultitaskMultivariateNormal, MultivariateNormal
label_desc: Use image node_id 2 for calling a global function with example usage: mean_squared_error(pred_dist, test_y, squared) and returns: res, unknown