code: def loss_2d(pred2d, gt2d):
      # return torch.sum(torch.abs(pred2d[..., :2] - gt2d[..., :2]), dim=-1).mean()
      return (
          torch.sum((pred2d[..., :2] - gt2d[..., :2]) ** 2, dim=-1)
          .sqrt()
          .mean()
      )
  
file_path: insightface/body/human_pose/ambiguity_aware/lib/core/loss.py
imports: import torch
  from torch.nn import functional
  import numpy
  import torch.nn
  import math
label_desc: Use image node_id 4 for calling a global function with example usage: loss_2d(pred2d, gt2d) and returns: torch