code: def gen_gaussian_target(heatmap, center, radius, k=1):
      """Generate 2D gaussian heatmap.
  
      Args:
          heatmap (Tensor): Input heatmap, the gaussian kernel will cover on
              it and maintain the max value.
          center (list[int]): Coord of gaussian kernel's center.
          radius (int): Radius of gaussian kernel.
          k (int): Coefficient of gaussian kernel. Default: 1.
  
      Returns:
          out_heatmap (Tensor): Updated heatmap covered by gaussian kernel.
      """
      diameter = 2 * radius + 1
      gaussian_kernel = gaussian2D(
          radius,
          sigma=diameter / 6,
          dtype=heatmap.dtype,
          device=heatmap.device,
      )
  
      x, y = center
  
      height, width = heatmap.shape[:2]
  
      left, right = min(x, radius), min(width - x, radius + 1)
      top, bottom = min(y, radius), min(height - y, radius + 1)
  
      masked_heatmap = heatmap[
          y - top : y + bottom, x - left : x + right
      ]
      masked_gaussian = gaussian_kernel[
          radius - top : radius + bottom, radius - left : radius + right
      ]
      out_heatmap = heatmap
      torch.max(
          masked_heatmap,
          masked_gaussian * k,
          out=out_heatmap[y - top : y + bottom, x - left : x + right],
      )
  
      return out_heatmap
  
imports: from math import sqrt
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: gen_gaussian_target(heatmap, center, radius, k) and returns: out_heatmap