code: def l2_loss(pred: Tensor, target: Tensor) -> Tensor:
      """L2 loss.
  
      Args:
          pred (torch.Tensor): The prediction.
          target (torch.Tensor): The learning target of the prediction.
  
      Returns:
          torch.Tensor: Calculated loss
      """
      assert pred.size() == target.size()
      loss = torch.abs(pred - target) ** 2
      return loss
  
file_path: mmdetection/mmdet/models/losses/l2_loss.py
imports: from typing import Optional, Tuple, Union
  import numpy
  import torch
  from mmengine.model import BaseModule
  from torch import Tensor
  from mmdet.registry import MODELS
  from .utils import weighted_loss
label_desc: Use image node_id 1 for calling a global function with example usage: l2_loss(pred, target) and returns: loss