code: def kl_criterion(mu1, sigma1, mu2, sigma2, mean_only=False):
      if mean_only:
          kld = (mu1 - mu2) ** 2 / (2 * sigma2**2)
      else:
          kld = (
              torch.log(sigma2 / sigma1)
              + (sigma1**2 + (mu1 - mu2) ** 2) / (2 * sigma2**2)
              - 1 / 2
          )
      return kld
  
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 1 for calling a global function with example usage: kl_criterion(mu1, sigma1, mu2, sigma2, mean_only) and returns: kld